Thanks Shai! That trick helped me a lot. I eventually managed to add 
migrations successfully using this trick and some manual adjustments to the 
migration files.

I'm optimistic that things will flow more easily from now on. Migrations is 
such an awesome addition to django, but I have to admit the circular 
dependencies were a serious bummer to handle. A guide on the subject by 
someone who knows its "ins and outs" would probably be extremely helpful.

Thanks again, Andrew.

On Friday, October 17, 2014 3:15:34 AM UTC+3, Shai Berger wrote:
>
> Hi Uri, 
>
> On Friday 17 October 2014 01:30:10 Uri P wrote: 
> > Thanks Andrew for enlightening me. That was helpful. 
> > 
> > Anyway, for me personally, data migration is the easiest part, I can do 
> it 
> > in a heartbeat by a simple script. 
> > In contrary, solving circular dependencies seems to be very difficult in 
> my 
> > case, especially in light of the currently still limited amount of 
> > documentation on the issue... 
> > 
> You've said that the circular dependencies are "enabled" by lazy loading, 
> which implies that the references are more-or-less regular foreign keys 
> (not, 
> for example, the implicit one-to-one key generated for multi-table 
> inheritance). In that case, breaking the circular dependency is not hard: 
> comment out one of the offending FKs (so there is no longer a circular 
> dependency), run makemigrations, un-comment it, and run makemigrations 
> again. 
> You will get, for the app where you did it, two migrations -- one creating 
> the 
> model without the FK, and one adding it, with all the dependencies 
> automatically set up. 
>
> It may be useful to add something like this to the migrations 
> documentation, 
> although I suspect there wll always be cases left uncovered, and solving 
> such 
> problems in general will ultimately require one to "know the ins and outs 
> of 
> the new migration system". 
>
> HTH, 
>
>         Shai. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d66c09a0-1ed3-42f4-932e-2847219d6a1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to