Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#34520 closed Uncategorized (invalid)

ModelAdmin.fields: wrapping in tuples does not have any effect (each field on separate line)

Reported by: Stefan Vollmar Owned by: nobody
Component: contrib.admin Version: 4.2
Severity: Release blocker Keywords: ModelAdmin fields wrapping tuples multiple-fields-per-line
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: yes

Description

According to the current Django 4.2 documentation, this

class FlatPageAdmin(admin.ModelAdmin):
    fields = [("url", "title"), "content"]

should display "url" and "title" on the same line. We use VersionAdmin (from django-reversion) instead of admin.ModelAdmin and everything works as expected with Django 4.1.8 but in Django 4.2, additional <div> blocks cause every field to be on its on new line. Sorry if this is a known problem.

Change History (4)

comment:1 by David Sanders, 19 months ago

Resolution: needsinfo
Status: newclosed

Hrm… I can't seem to reproduce this on a sample project with latest main. I can place fields side-by-side and it seems to be all working ok.

Is there any more info you could provide? Do you happen to have a small example project on github or something? 🤔 (Also can you test on main?)

(closing until getting more context)

comment:2 by Natalia Bidart, 19 months ago

Could you try with the Django's ModelAdmin instead? If you can't reproduce in that case, then it seems this is something to report to django-reversion.

comment:3 by Stefan Vollmar, 19 months ago

Resolution: needsinfofixed

I created a new model using admin.ModelAdmin instead of VersionAdmin (from django-reversion) leaving everything else unchanged: the problem seems indeed to be related to VersionAdmin: admin.ModelAdmin works as expected; I will report this to the django-reversion project.

comment:4 by Mariusz Felisiak, 19 months ago

Resolution: fixedinvalid

Marking as "invalid" because it's not an issue in Django itself.

Note: See TracTickets for help on using tickets.
Back to Top