#14691 closed (fixed)
foreign key validate() fails for non-default databases
| Reported by: | marcop | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Keywords: | validation, foreign key, mutiple_database | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
to reproduce:
- configure two databases:
defaultandother - have two models Person and Pet:
class Person(models.Model): name = models.CharField(max_length=100) class Pet(models.Model): name = models.CharField(max_length=100) owner = models.ForeignKey(Person) - create Person instance named
personin database 'other' - create Pet instance named
petin database 'other' - try calling
pet.full_clean()or, more specifically,pet._meta.get_field('owner').validate(person.pk, person)
patch and test attached
Attachments (3)
Change History (7)
by , 15 years ago
| Attachment: | multidb_foreignkey_validation_patch.diff added |
|---|
by , 15 years ago
| Attachment: | multidb_management_tests.diff added |
|---|
by , 15 years ago
| Attachment: | 14691.diff added |
|---|
comment:1 by , 15 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
Seems multidb_management_tests.diff you a attached are actually tests for other ticket you opened #14662.
Attached another patch that only adds tests.
comment:3 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:4 by , 15 years ago
Note:
See TracTickets
for help on using tickets.
Patch with tests