[EMAIL PROTECTED] wrote:
> I came across this in Django's documentation:
> (http://www.djangoproject.com/documentation/model_api/#many-to-one-relationships)
>
> (...)
> limit_choices_to:
> A dictionary of lookup arguments and values (...)that limit
> the available admin choices for this
I came across this in Django's documentation:
(http://www.djangoproject.com/documentation/model_api/#many-to-one-relationships)
(...)
limit_choices_to:
A dictionary of lookup arguments and values (...)that limit
the available admin choices for this object.
Instead of a dictionary this
Good question - short answer is it's not anything I tried to do, so I
don't know...
Cheers,
Tone
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Hi guys,
Sidestep question about 'limit_choices_to':
is it possible to limit choices of a foreign key according to
the value of another field in my model?
In your example, the value 'Administration' is hard-coded...
Thanks.
>
> Sorry Q,
> I forgot to add the WorkGroup definition;
>
> class
Sorry Q,
I forgot to add the WorkGroup definition;
class WorkGroup(models.Model):
groupName = models.CharField(maxlength=50)
def __str__(self):
return "%s" % self.groupName
That's where the 'groupName' is coming from in my lookup.
I'm using rev 2900 (ie the merged MR trunk) so
Thanks for the tip. Your example didn't quite work for me. I changed
it to:
'groups__name__exact'
Possibly it's because we are using different versions? I'm using the
most recent trunk (magic-removal-branch).
One question if you don't mind answering. I'm guessing that there is
juju going
This works (it's the pa - personal assistant - bit you want);
class Person(models.Model):
firstName = models.CharField(maxlength=50)
lastName = models.CharField(maxlength=50)
organization = models.ManyToManyField(Organization, related_name =
'organization')
emailAddress =
7 matches
Mail list logo