Opened 16 years ago
Closed 16 years ago
#7600 closed (duplicate)
bug in postresql sequence_reset_sql causes "loaddata" to fail for derived class with alternate primary key
Reported by: | Shaun Cutts | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
django.db.backends.postgresql.operations.sequence_reset.sql loops over "fields" when searching for primary keys:
for f in model._meta.fields:
But it should loop only over fields specific to that class:
for f in model._meta.local_fields:
With this fix, loaddata works on such derived models.
Attachments (1)
Change History (3)
by , 16 years ago
Attachment: | operations.patch added |
---|
comment:1 by , 16 years ago
Has patch: | set |
---|
comment:2 by , 16 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Looks like a dupe of #7565, which was fixed in [7789].