Re: Can a ManyToManyField only shows certain records in an admin using edit_inline?

2007-08-05 Thread Greg
We'll I created a new function called r_col. That returns a value to my sandp field from within the Style Class. However, I'm not sure how to pass it the current value of the collection field from within the Style Class. Below are my model files: class Choice(models.Model): choice =

Re: Can a ManyToManyField only shows certain records in an admin using edit_inline?

2007-08-01 Thread Greg
Anybody? On Aug 1, 2:49 pm, Greg <[EMAIL PROTECTED]> wrote: > Ok..does anybody know what's wrong with this attempt at trying to get > the 'limit-choices_to' to work? > > class Choice(models.Model): > choice = models.ForeignKey(Collection, edit_inline=models.TABULAR, > num_in_admin=5) >

Re: Can a ManyToManyField only shows certain records in an admin using edit_inline?

2007-08-01 Thread Greg
Ok..does anybody know what's wrong with this attempt at trying to get the 'limit-choices_to' to work? class Choice(models.Model): choice = models.ForeignKey(Collection, edit_inline=models.TABULAR, num_in_admin=5) size = models.ForeignKey(Size, core=True) price =

Re: Can a ManyToManyField only shows certain records in an admin using edit_inline?

2007-08-01 Thread Greg
We'll I kinda got it to work. I added the following (limit_choice_to): sandp = models.ManyToManyField(Choice, limit_choices_to = {'choice': 2}) /// That works fine. However, I obviously want to take out the '2'. I tried the following but it does not seem to work: sandp =

Re: Can a ManyToManyField only shows certain records in an admin using edit_inline?

2007-08-01 Thread Will McCutchen
> Is there anyway that I can have the 'sandp' Field only > show choices that are tied to that collection? Try using the limit_choices_to argument to ManyToManyField: http://www.djangoproject.com/documentation/model-api/#many-to-many-relationships Hope this helps, Will.

Re: Can a ManyToManyField only shows certain records in an admin using edit_inline?

2007-07-31 Thread Amirouche
> Is there anyway that I can have the 'sandp' Field only > show choices that are tied to that collection? This is the purpose of making ForeignKeys I guess. You may try: mycollection = Collection.objects.all()[0] related_choices = Choice.objects.filter(choice=mycollection) I think that