Modify

Ticket #581 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

Change from models.py to models module results in deletion of all models

Reported by: thomas.paul.matthews@… Owned by: andrew
Priority: major Milestone: 0.7.3
Component: migrations Version: 0.7.2
Keywords: models, module Cc:

Description

I started my app with all the models in models.py, but this grew unwieldy (the models are for storing data from a particular type of scientific experiment and dont really seem to warrant separate apps). I created a models directory within the app with init.py and several files for the models. The code for the models was unchanged, other than to add app_label under Meta and update the imports. I ran a schemamigration --auto for the app and it detected that I had deleted all of my models, even though I just moved them.

Thanks.

Attachments

Change History

comment:1 in reply to: ↑ description Changed 4 years ago by thomas.paul.matthews@…

Replying to thomas.paul.matthews@…:

I started my app with all the models in models.py, but this grew unwieldy (the models are for storing data from a particular type of scientific experiment and dont really seem to warrant separate apps). I created a models directory within the app with init.py and several files for the models. The code for the models was unchanged, other than to add app_label under Meta and update the imports. I ran a schemamigration --auto for the app and it detected that I had deleted all of my models, even though I just moved them.

Thanks.

The error was mine. Importing the models in init.py fixed the problem. The ticket can be marked invalid. Sorry.

comment:2 Changed 4 years ago by andrew

  • Status changed from new to closed
  • Resolution set to invalid
  • Milestone set to 0.7.3
View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.