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:


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.

Attachments (0)

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

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.