Opened 5 years ago

Closed 5 years ago

#12580 closed (duplicate)

New validations pulls all elements for foreignkeys

Reported by: jtiai Owned by: nobody
Component: Forms Version: master
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: UI/UX:

Description

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 5 years ago by Honza_Kral

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #12510

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