[Django] #34520: ModelAdmin.fields: wrapping in tuples does not have any effect (each field on separate line)

12 views
Skip to first unread message

Django

unread,
Apr 26, 2023, 11:35:39 AM4/26/23
to django-...@googlegroups.com
#34520: ModelAdmin.fields: wrapping in tuples does not have any effect (each field
on separate line)
-------------------------------------+-------------------------------------
Reporter: Stefan | Owner: nobody
Vollmar |
Type: | Status: new
Uncategorized |
Component: | Version: 4.2
contrib.admin | Keywords: ModelAdmin fields
Severity: Release | wrapping tuples multiple-fields-
blocker | per-line
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-------------------------------------+-------------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/34520>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 26, 2023, 11:56:39 AM4/26/23
to django-...@googlegroups.com
#34520: ModelAdmin.fields: wrapping in tuples does not have any effect (each field
on separate line)
-------------------------------------+-------------------------------------
Reporter: stefanvollmar | Owner: nobody
Type: Uncategorized | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Release blocker | Resolution: needsinfo
Keywords: ModelAdmin fields | Triage Stage:
wrapping tuples multiple-fields- | Unreviewed
per-line |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by David Sanders):

* status: new => closed
* resolution: => needsinfo


Comment:

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)

--
Ticket URL: <https://code.djangoproject.com/ticket/34520#comment:1>

Django

unread,
Apr 27, 2023, 4:50:12 PM4/27/23
to django-...@googlegroups.com
#34520: ModelAdmin.fields: wrapping in tuples does not have any effect (each field
on separate line)
-------------------------------------+-------------------------------------
Reporter: Stefan Vollmar | Owner: nobody

Type: Uncategorized | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Release blocker | Resolution: needsinfo
Keywords: ModelAdmin fields | Triage Stage:
wrapping tuples multiple-fields- | Unreviewed
per-line |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Natalia Bidart):

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`.

--
Ticket URL: <https://code.djangoproject.com/ticket/34520#comment:2>

Django

unread,
Apr 29, 2023, 10:46:44 AM4/29/23
to django-...@googlegroups.com
#34520: ModelAdmin.fields: wrapping in tuples does not have any effect (each field
on separate line)
-------------------------------------+-------------------------------------
Reporter: Stefan Vollmar | Owner: nobody
Type: Uncategorized | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Release blocker | Resolution: fixed

Keywords: ModelAdmin fields | Triage Stage:
wrapping tuples multiple-fields- | Unreviewed
per-line |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Stefan Vollmar):

* resolution: needsinfo => fixed


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/34520#comment:3>

Django

unread,
Apr 29, 2023, 11:27:00 AM4/29/23
to django-...@googlegroups.com
#34520: ModelAdmin.fields: wrapping in tuples does not have any effect (each field
on separate line)
-------------------------------------+-------------------------------------
Reporter: Stefan Vollmar | Owner: nobody
Type: Uncategorized | Status: closed
Component: contrib.admin | Version: 4.2
Severity: Release blocker | Resolution: invalid

Keywords: ModelAdmin fields | Triage Stage:
wrapping tuples multiple-fields- | Unreviewed
per-line |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* resolution: fixed => invalid


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/34520#comment:4>

Reply all
Reply to author
Forward
0 new messages