Django

Code

Ticket #7565 (closed: fixed)

Opened 3 months ago

Last modified 3 months ago

Fixture problem with child models

Reported by: casey@deccio.net Assigned to: mtredinnick
Milestone: Component: Uncategorized
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

There seems to be a problem importing fixtures for child models. Supposing I have a model myapp.MyGroup? that inherits from auth.Group, and I have a fixture that includes MyGroup? data, I receive the following error:

psycopg2.ProgrammingError?: column "id" does not exist at character 54

generated from this SQL:

SELECT setval('"myapp_mygroup_id_seq"', coalesce(max("id"), 1), max("id") IS NOT null) FROM "myapp_mygroup";

As far as I can tell, it appears that it is attempting to updating the sequence for the pk of the child model (for which there is none) using the "myapp.mygroup.id" column (which doesn't exist).

Attachments

Change History

06/29/08 19:19:27 changed by mtredinnick

  • owner changed from nobody to mtredinnick.
  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

06/29/08 19:38:14 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(In [7789]) Fixed #7565 -- Fixed a problem with PostgreSQL sequence resetting in loaddata.

07/03/08 13:42:48 changed by ikelly

(In [7831]) Refs #7565. Fixed Oracle sequence resetting on child models.


Add/Change #7565 (Fixture problem with child models)




Change Properties
Action