On Aug 7, 3:00 pm, Masklinn <maskl...@masklinn.net> wrote:
> On 7 Aug 2009, at 23:33 , Milan Andric wrote:
>
>
>
>
>
> > Hello I have two apps that have foreign keys to each other.  Like:
>
> > people.models:
>
> >  class Profile(Model):
> >     secondary_email = CharField()
>
> >  class Staff(Profile):
> >     office = ForeignKey(Room)
>
> > resources.models:
>
> >  class Room(Model):
> >     name = CharField()
>
> >  class Reservation(Model):
> >     profile = ForeignKey(Profile)
>
> > Runserver seems to work fine but when i do ./manage.py sqlall people I
> > get a "Error: App with label people could not be found. Are you sure
> > your INSTALLED_APPS setting is correct?" error.
>
> > Is there a way around this or do I need to rip my apps apart so I can
> > foreign key to my rooms model?
>
> > Thanks,
>
> > Milan
>
> To the other comments I'd add that… does it really make sense to make  
> two apps which completely depend on one another that way? Apps are  
> supposedly independent blocks of function, making one depend on/extend  
> another one makes sense but two apps mutually requiring each other  
> should probably be merged into a single app, as they're always going  
> to be used together…
>
> No?

Hi Masklinn,  this is a good point and also crossed my mind.  The two
apps definitely don't belong as one because they serve very different
purposes.  All I was trying to do is minimize data replication since a
profile can point to room object rather than a charfield.   One idea I
had was to create an Office model in the resources app that would link
a Profile to a Room, and remove the office field from the profile.
Then this relation would be in the resources app and the circular
dependency would go away.  But that doesn't sit with me well either,
seems unnatural.

--
Milan
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to