Opened 14 years ago
Closed 9 years ago
#13771 closed Bug (duplicate)
ForeignKey and Many2Many validation fails between databases
Reported by: | jdetaeye | Owned by: | Andrii Kurinnyi |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | multidb |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
The validation of ForeignKey and Many2Many fields isn't selecting the right database. The validity of the PKs in the referenced table is always checked in the database chosen by the _default_manager. If that database is different than the one containing the model_instance, this validation check is incorrect.
See http://groups.google.com/group/django-users/browse_thread/thread/639df3f9412ef1d3#
Attachments (2)
Change History (11)
by , 14 years ago
Attachment: | related_field_validation.patch added |
---|
comment:1 by , 14 years ago
Patch needs improvement: | set |
---|
comment:2 by , 14 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 14 years ago
Has patch: | set |
---|---|
Needs tests: | unset |
isValidIDList method on ManyToManyField, mentioned in previous patch dosn't seem to be used anywhere in Django, and hasn't been updated since magic-removal branch got merged.
It looks like it was used in ManyToManyField constructor before, but it is not used now.
comment:4 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:13 by , 9 years ago
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
Seems to be a duplicate of #14691 which was fixed in 1.3.
partial patch