Opened 13 years ago

Closed 13 years ago

#12580 closed (duplicate)

New validations pulls all elements for foreignkeys

Reported by: Jani Tiainen Owned by: nobody
Component: Forms Version: dev
Severity: Keywords: validation foreignkey admin modelform
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Model validation added validate() method on forms.fields.Field . This method is called in a validation call chain from ModelChoiceField . validate() method is only in ModelChoiceField which inherits ChoiceField . validate() method pulls in all data from foreign key model by using expensive for loop.

Model forms and admin forms both suffer from this feature. Specially admin forms with raw_id_field when referring to model that contains millions of rows.

Change History (1)

comment:1 Changed 13 years ago by Honza Král

Resolution: duplicate
Status: newclosed

Duplicate of #12510

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