Django

Code

Ticket #7245 (new)

Opened 2 months ago

Last modified 3 weeks ago

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

Reported by: m.gajda@paranoja.pl Assigned to: nobody
Milestone: Component: Core framework
Version: SVN Keywords: bug oldforms row duplication change
Cc: m.gajda@paranoja.pl Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 1 Patch needs improvement: 0

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

propagate-all-pk-values-7245.patch (0.7 kB) - added by m.gajda@paranoja.pl on 05/15/08 17:01:51.
Propagate all pk values patch

Change History

05/15/08 17:01:51 changed by m.gajda@paranoja.pl

  • attachment propagate-all-pk-values-7245.patch added.

Propagate all pk values patch

06/16/08 01:29:43 changed by programmerq

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests set to 1.
  • needs_docs changed.

Add/Change #7245 ([BUG] Data row duplication while changing inherited models using oldforms manipulators)




Change Properties
Action