On Mon, Nov 10, 2008 at 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.
>

I don't know what "fails to load" means -- that is, you haven't made it
clear what you are doing when the error is triggered.  manage.py runserver?
Something in the admin? Also the full traceback would be helpful, since that
would give a clue what portion of the Djano code is objecting.  As is I
suspect you are doing something with inlines but haven't told the admin
which ForeignKey to use, see:

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#fk-name

If that's not it please provide more specifics of what you are doing and the
traceback received.

Karen

--~--~---------~--~----~------------~-------~--~----~
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