if i have something like this:
=======
class MyModel(models.Model):
name = models.CharField(max_length=255)
class OtherModel(models.Model):
name = models.CharField(max_length=255)
mymodel = models.ForeignKey(MyModel)
class MyModelItem(models.Model):
mymodel = models.ForeignKey(MyModel)
other = models.ForeignKey(OtherModel, null=True, blank=True)
=======
how can i use limit_choices_to (or some other way) to filter
ForeignKey choices based on current model field?
basically, how can i do:
other = models.ForeignKey(OtherModel, null=True, blank=True,
limit_choices_to={'mymodel': 'self.mymodel'})
any options works for me (overwriting admin.TabularInline or form for
TabularInline).
thanks for any info.
Aljosa
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.