Re: Alternate ForeignKey based on choices

2008-10-27 Thread David Cramer
What you're wanting is a GenericForeignKey. Check out the django.contrib.contenttypes documentation. On Oct 26, 9:48 am, "Calvin Spealman" <[EMAIL PROTECTED]> wrote: > You could also have a common parent class for Robot and User, and use that > as your foreign key type. Which type is referenced w

Re: Alternate ForeignKey based on choices

2008-10-26 Thread Calvin Spealman
You could also have a common parent class for Robot and User, and use that as your foreign key type. Which type is referenced would be your determination of user type. On Sun, Oct 26, 2008 at 6:19 AM, CooLMaN <[EMAIL PROTECTED]> wrote: > > Hello, > > I have an application with a model similar to

Alternate ForeignKey based on choices

2008-10-26 Thread CooLMaN
Hello, I have an application with a model similar to the following: class Relations(models.Model): user1 = models.ForeignKey(User, related_name='relations_user1_set', editable=False) user2 = models.ForeignKey(User, related_name='relations_user2_set', editable=False) userTy