Opened 17 years ago

Closed 16 years ago

#7245 closed (invalid)

[BUG] Data row duplication while changing inherited models using oldforms manipulators

Reported by: m.gajda@… Owned by: nobody
Component: Core (Other) Version: dev
Severity: Keywords: bug oldforms row duplication change
Cc: m.gajda@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've discovered using admin application, that while trying to save some existing object, which model class inherits from other model class, a new rows are added to database instead of changing the existing ones.

The problem is save method of the django.db.models.manipulators.AutomaticManipulator class, which does not set primary key values for super class models, which should be later processed by model's save method.

The attached patch tries to solve this bug by setting primary key values on all super models while preparing data to save in manipulator class. It works for me, but I did not run test suites to check the behaviour in all cases.

Attachments (1)

propagate-all-pk-values-7245.patch (678 bytes ) - added by m.gajda@… 17 years ago.
Propagate all pk values patch

Download all attachments as: .zip

Change History (3)

by m.gajda@…, 17 years ago

Propagate all pk values patch

comment:1 by Jeff Anderson, 16 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 by Adrian Holovaty, 16 years ago

Resolution: invalid
Status: newclosed

Closing, because manipulators are gone.

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