limit-choices-to

Django MTMField: limit_choices_to = other_ForeignKeyField_on_same_model?

I've got a couple django models that look like this: from django.contrib.sites.models import Site class Photo(models.Model): title = models.CharField(max_length=100) site = models.ForeignKey(Site) file = models.ImageField(upload_to=get_site_profile_path) def __unicode__(self): return self.title class Gallery...

limit choices to foreignkey using middleware

I'm looking to do something like this: http://stackoverflow.com/questions/160009/django-model-limitchoicestouser-user with some differences. Some models may explain: class Job(models.Model): name = models.CharField(max_length=200) operators = models.ManyToManyField(User) class Activity(models.Model): job = models.Foreign...

Dynamic filtering on FK in Django Admin

I have one Product Model that has a FK to price, as one product can contain many prices. But I also want to be able to pick which one of those many prices should be the actual price, therefore I have both price (in Product Model) and product (in Price Model) to accomplish this. Consider these following models: class Product(models.Model...