On Sep 18, 2016 10:22 PM, "Ali khan" <[email protected]> wrote: > > Thank you for your kind response James. > > I must be doing something wrong but I thought that importing different models and assigning them with variable may had help me to filter it out. I will try your suggestion first to save your valued time and then will post with result. > > Let me add a field for the seller in my "Orders" model like "seller = models.ForeignKey(Seller)" and then filter it out. > But I tried that before still as per your suggestion I will do that again. > Thanks again. >
Once you do that, you can filter the orders with something like this: orders = Order.objects.filter(seller__user=user) Inside of the filter function you defined. The way you are currently doing it, you'll end up with Seller objects rather than Order objects. -James -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CA%2Be%2BciX6N3eQOnb5dP877WM0FEgj%2BAjt-QfT6anwE5jNMafx3Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

