Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#12582 closed (fixed)

Model validation of ForeignKeys ignore limit_choices_to

Reported by: Honza Král Owned by: Honza Král
Component: Uncategorized Version: dev
Severity: Keywords: validation limit choices foreign keys
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When checking valida value of a FK field:

self.rel.to._default_manager.get(**{self.rel.field_name:value})

is used instead of more efficient .exists() and limit_choices_to option is ignored

Attachments (1)

12582.diff (2.4 KB ) - added by Honza Král 14 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by Honza Král, 14 years ago

Needs tests: set
Status: newassigned
Triage Stage: UnreviewedAccepted

by Honza Král, 14 years ago

Attachment: 12582.diff added

comment:2 by Honza Král, 14 years ago

Needs tests: unset

comment:3 by jkocherhans, 14 years ago

Resolution: fixed
Status: assignedclosed

(In [12271]) Fixed #12582. Model validation on ForeignKeys now respects limit_choices_to. Thanks, Honza Král.

comment:4 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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