Tomas Kopecek napsal(a):
> Tim Chase napsal(a):
> I> does anybody knows, how to implement cross-refering models across files?
>>   # in example_app/models_a.py
>>   class A(models.Model):
>>     # no ref_to_b here
>>     ...
>>
>>   # in example_app/models_b.py
>>   import a
>>   class B(models.Model):
>>     ref_to_a = models.OneToOneField(a.A,
>>       related_name='ref_to_b')
>>
>>   # in example_app/models.py
>>   from models_a import *
>>   from models_b import *
>>
> Is this correct method for future django releases? Documentation says on 
> one-to-one: "The semantics of one-to-one relationships will be changing 
> soon, so we don't recommend you use them." Maybe this is more question 
> for django-devel...
> 
Moreover, it is not sufficient (general enough) solution. if ref_to_b 
and ref_to_a are two independent many-to-one relations, I can't use 
one-to-one semantics.

-- 

                        Tomas Kopecek
                        e-mail: permonik at mesias.brnonet.cz
                         ICQ: 114483784

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to