I've tried many ways but it ends with the same error that says:
Cannot query "alikhan": Must be "User" instance.
Where alikhan is admin user I've created with createsuperuser.
Hate to bother you again but please advise.
On Sun, Sep 18, 2016 at 11:08 PM, James Schneider <jrschneide...@gmail.com>
> 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
> > 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 firstname.lastname@example.org.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> For more options, visit https://groups.google.com/d/optout.
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 post to this group, send email to email@example.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.