Opened 19 years ago

Closed 19 years ago

#1092 closed defect (fixed)

[patch] Fix set fields defaults in admin forms on adding from GET params

Reported by: plisk Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Because of request.GET is an QueryDict object it returns list even for param with only 1 value, like if you pass to your add form ...my_object/add/?name=Foo you'll see Foo in the Name field. This patch fixes this behaviour to correctly set fields defaults so Foo is Foo, not Foo on the forms. Preselect of fields with ForeignKey should also start to work.

Attachments (1)

admin_form_defaults_via_GET.patch (882 bytes ) - added by plisk 19 years ago.

Download all attachments as: .zip

Change History (2)

comment:1 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

(In [1758]) Fixed #1092 -- Fixed behavior for query-string overrides in admin forms

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