complicated limit_choices_to on an inline-edited page

2007-07-12 Thread Charles Wesley
I have a ForeignKey field with the option: limit_choices_to = {'team__id': Game.objects.get(pk=1).visitor_team.id} This class is coded to be edited inline by another class. When I use the limit_choices_to option above, I can access the class directly, but not through the other class. When I chan

Re: Trying to use many-to-many to emulate a one-to-one field

2007-07-06 Thread Charles Wesley
Correction: Use a many-to-ONE field On Jul 3, 3:06 pm, Charles Wesley <[EMAIL PROTECTED]> wrote: > Hi, > > Since I can't (as far as I can tell) enable inline editing on a one-to- > one field, I'm trying to use an inline-edited many-to-many field with > a relat

Re: Trying to use many-to-many to emulate a one-to-one field

2007-07-06 Thread Charles Wesley
Correction: Use a many-to-ONE field On Jul 3, 3:06 pm, Charles Wesley <[EMAIL PROTECTED]> wrote: > Hi, > > Since I can't (as far as I can tell) enable inline editing on a one-to- > one field, I'm trying to use an inline-edited many-to-many field with > a relat

Trying to use many-to-many to emulate a one-to-one field

2007-07-03 Thread Charles Wesley
Hi, Since I can't (as far as I can tell) enable inline editing on a one-to- one field, I'm trying to use an inline-edited many-to-many field with a related object maximum of 1. Trivial example: class Trivial(models.Model): name = models.CharField(maxlength=50) class Admin: pass

multiple OneToOne fields pointing to the same table

2007-06-26 Thread Charles Wesley
I want a model where a single table has two OneToOne fields pointing back to another table. Here's the trivial example: class Trivial(models.Model): pass class Multiple(models.Model): one_trivial = models.OneToOneField(Trivial, related_name="one_trivial") two_trivial = models.OneToO

Re: Meta class preventing table add

2007-06-26 Thread Charles Wesley
I am using MySQL. Thanks for clearing that up! charles On Jun 25, 3:02 pm, Brian Rosner <[EMAIL PROTECTED]> wrote: > On 2007-06-25 14:10:30 -0600, Charles Wesley <[EMAIL PROTECTED]> said: > > > > > > > Hello, > > > I'm a Django newbie, and

Meta class preventing table add

2007-06-25 Thread Charles Wesley
Hello, I'm a Django newbie, and I'm trying to set up a model that includes the following table: class Team(models.Model): school = models.ForeignKey(School, unique_for_year="season_start_date") season_start_date = models.DateField() division = models.ForeignKey(Division) coach_fi