Ticket #360 (closed defect: fixed)

Opened 6 years ago

Last modified 3 years ago

Loaddata breaks in Django 1.2

Reported by: anonymous Owned by: andrew
Priority: major Milestone: 0.7
Component: migrations Version: 0.6.2
Keywords: Cc:


LoadInitialDataMigrator? monkey patches django.models.get_app, so that the loaddata management command only loads from the currently migrated application.

This breaks in Django 1.2 because it loads the method differently.

The attached patch also monkey patches get_apps in loaddata.py, so that it works in Django 1.2


laoddata_django_1_2_fix.patch (1.5 KB) - added by sverre.johansen@… 6 years ago.
Patch for fixing LoadInitialDataMigrator? for Django 1.2

Change History

Changed 6 years ago by sverre.johansen@…

Patch for fixing LoadInitialDataMigrator? for Django 1.2

comment:1 Changed 6 years ago by andrew

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 0.7

Committed as [6e99ee799d3f]. Thanks for the patch!

comment:2 Changed 3 years ago by Jhon

This is a pretty old potisng, but yesterday i found this page, so i want to post my solution to this problem here.What you actually can do is to insert your SQL INSERT statements for the many-to-many table created by django within a sql file of one of the models defined by you.I had the same problem, a model called image and a model called profile , where i used a many-to-many relation to image in my profile model. I now just appended the profile_images sql code to my image.sql code. It works great!

Note: See TracTickets for help on using tickets.