Klaas,

When you create a Foreign Key to another model, Django also sets up
the "reverse relation".  If you specify more than one foreign key to
the same model, you must give different names for this reverse
relationship.

http://docs.djangoproject.com/en/dev/topics/db/queries/#backwards-related-objects

js

On Nov 10, 3:50 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have a UserProfile connected to auth.models.User using
>
>     user = models.ForeignKey(User, unique=True)
>
> Additionally, I'd like to connect users to each other with manager/
> managed hierarchical relationships, whereby everyone has one manager
> (except the big boss who has none):
>
>     manager = models.ForeignKey(User, blank=True,
> related_name='employees_userprofile_manager')
>
> My models fail to load with the exception:
> <class 'django_intranet.employees.models.UserProfile'> has more than 1
> ForeignKey to <class 'django.contrib.auth.models.User'>
>
> This doesn't seem logical to me at all: the above is a perfectly fine
> example of two foreign keys being meaningful. Why is this not possible
> and what is the workaround, or rather, the proper way to do this?
>
> I'm using Django 1.0.
>
> Any help is much appreciated.
>
> regards,
> Klaas van Schelven
--~--~---------~--~----~------------~-------~--~----~
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