On Sep 18, 2016 10:22 PM, "Ali khan" <alipathan123...@gmail.com> 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.


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 
For more options, visit https://groups.google.com/d/optout.

Reply via email to