Code

Opened 4 years ago

Closed 3 years ago

Last modified 9 months ago

#14238 closed Uncategorized (invalid)

admin-interface and formsets: ordered_forms are not returned in case of errors

Reported by: sehmaschine@… Owned by: nobody
Component: contrib.admin Version: 1.2
Severity: Normal Keywords:
Cc: sehmaschine@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

ticket http://code.djangoproject.com/ticket/11801 seems to address this issue - though it´s not solved with the admin-interface yet.

an example:
I´m having tabular-inlines and I´m reordering the forms. now, in case of an error (somewhere, not necessarily within this formset), the forms are displayed in the wrong order (as before re-ordering them). solving this issue would allow for sortable inlines (e.g. with drag/drop-functionality).
of course, InlineModelAdmin needs something like can_order (which is currently not available).

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by anonymous

  • Cc sehmaschine@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by julien

  • Resolution set to invalid
  • Status changed from new to closed

I think #11801 is a different issue. In your case, the forms are displayed in the wrong order probably because the objects haven't been saved (because there was a validation error) and because the ordering is probably based on the values that are stored in the database and not the values that are temporarily "stored" in the forms. It looks like you would have to use some custom javascript to reorder the inlines based on the values that are in the forms.

In any case, there's not much we can do without seeing any specific test case, so I'm marking this ticket as invalid. Feel free to reopen if you can provide such a detailed test case (e.g. models, admin configurations, etc). You may also try asking for help on the Django user mailing list: http://groups.google.com/group/django-users/topics

comment:3 Changed 9 months ago by sehmaschine@…

  • Easy pickings unset
  • Severity set to Normal
  • Type set to Uncategorized
  • UI/UX unset

You have explained the testcase yourself – the problem is that the forms are ordered by the stored/database value instead of the form–value.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.