hi, I have 3 models: class Orders(models.Model): brand = models.ForeignKey( Brands, verbose_name = "Brand", null=True, blank=True, related_name="ord_brand" ) dateord = models.DateField("Date") numbord = models.CharField("Number", max_length=20, unique_for_year="dateord", )
class OrderRows(models.Model): order = models.ForeignKey( Orders, verbose_name = "Order", ) product = models.ForeignKey( Products, verbose_name = "Product", ) price = models.DecimalField("Price", max_digits = 11, decimal_places=2, ) class Products(models.Model): brand = models.ForeignKey( Brands, verbose_name = "Brand", ) code = models.CharField("Code", max_length=25, ) descr = models.CharField("Description", max_length=50, ) In my admin.py I have a ModelForm for Orders and an Inline for OrderRow. In the Inline I need filter product queryset for records where brand=orders.brand. How can I do it? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3f1d5cc5-6485-4f90-b626-929dc6d0e353%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.