Hi Folks,
I have two app in a django project. Both app contains a model-file. In
this model-files are the models (tables) for my application. I
imported one of the model in the other application because I created
there a foreign key for that. When I now try to import one of the
other model in that application I always get an ImportError.
Is this not possible because that would be a kind of never ending
circle?
How can I do this?
Example (maybe my declaration isn't clear):
models.py from app1 may be look like this:
from django.db import models
from app2.models import App2Test1
class App1Test1(models.Model):
testfield1 = models.CharField(max_length=10)
testfield2 = models.DateField()
testfield3 = models.ForeignKey (App2Test1)
class App1Test2(models.Model):
testfield1 = models.CharField(max_length=10)
testfield2 = models.DateField()
----------------------------------------------------------------------------
models.py from app2 may be look like this:
from django.db import models
from app1.models import App1Test2
class App2Test1(models.Model):
testfield1 = models.CharField(max_length=10)
testfield2 = models.DateField()
class App2Test2(models.Model):
testfield1 = models.CharField(max_length=10)
testfield2 = models.DateField()
testfield3 = models.ForeignKey (App1Test2)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---