On Oct 30, 10:13 pm, Alex G <[EMAIL PROTECTED]> wrote: > Thanks for the reply, DR. > > How would I use the generic relationship without the backward link? > > I have the normal auth.user class, and I have the my.user class that > extends it and has a polymorphic link pointing at auth.user. The > problem occurs when I collect a login/password, because I can't lookup > my.user without the backward link, that is I can't > my.user.filter(account__username = x, account__password = y) because > polymorphic links don't allow this. I also can't move in reverse, the > auth.user.authenticate(username, password) function returns an > auth.user, and I am unclear as to how I would get a my.user from this > information without calling for my.user.objects.all() and comparing > the link (which seems terribly, terribly inefficient...). Is there a > way to start with the target (auth.user) and get to my.user backward > via the contenttype?
Something like (where 'dj_user' is the instance of contrib.auth.models.User): User.objects.get(account_id=dj_user.id, account_polymorphic_link=ContentType.objects.get_for_model(dj_user)) -- DR. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---