Re: Foreign Key Chicken/Egg Inline Fu

2012-05-30 Thread Patrick Gavin
Thanks Kurtis! That is helpful. -Patrick On May 30, 1:14 pm, Kurtis Mullins wrote: > I just checked on my own code that does something in a different > context but kinda performs the same check. I thought I'd share it with > you in case it helps out at all. > >    

Re: Foreign Key Chicken/Egg Inline Fu

2012-05-30 Thread Kurtis Mullins
I just checked on my own code that does something in a different context but kinda performs the same check. I thought I'd share it with you in case it helps out at all. def clean_title(self): # Grab the data to verify this Title is unique to this user. title =

Re: Foreign Key Chicken/Egg Inline Fu

2012-05-30 Thread Kurtis Mullins
Sorry, I completely mis-read the last part of your problem. You already thought about the same solution, haha. You might be able to modify the Player model's clean (or save) method to prohibit any Team from having more than one team captain. However, I'd probably just check it in the Form you're

Re: Foreign Key Chicken/Egg Inline Fu

2012-05-30 Thread Kurtis Mullins
Unless a player can play for multiple teams (which I'm doubting since Team is a ForeignKey for a Player), why not remove that 'captain' attribute from your Team and put it into your Player model as a boolean field? You could create a ModelManager or class-level model method to grab the associated

Foreign Key Chicken/Egg Inline Fu

2012-05-30 Thread Patrick Gavin
Hi- I'm new to Django, but so far I think it is the bee's knees. I could use some insight into a problem I'm working on. Given the following... - # models.py from django.db import models class Team(models.Model): name = models.CharField(max_length=30)