Hi everyone.

I'm working on a mid-sized web project, and have run into a bit of a
dead-end trying to figure out how to make my custom manager method
`for_user` return a a proper Django QuerySet.

First off, here's my: myproject/partylines/models.py source code which
contains the problem that I'm trying to figure out:
http://pastie.org/private/zrqc0wklg4nwpmu8oce8aq

I'm attempting (in another part of my website) to render a form which
displays a dropdown of all Partyline objects that a given user owns.
My form looks like: http://pastie.org/private/mimiwo1vlafz5cxktn2gla

As you can see, the form accepts a custom parameter (user), and should
modify the queryset to show *only* Partyline objects that the
specified user owns. In the original paste which contains my manager
code, you'll see that I've overridden the default 'objects' manager
with my custom manager that has a single method, `for_user`, that
returns a list of Partylines that a user owns.

Basically, since my `for_user` manager method returns a list, and not
a QuerySet, the __init__ field in my `PartylineReportForm` class
doesn't work because it requires a QuerySet.

What I'm trying to figure out is, how can I modify my `for_user`
manager method to return a QuerySet instead of a list? I've been
googling this for hours, and haven't seen any examples or found any
documentation.

If anyone could help me out I would greatly appreciate it.

Thanks so much!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to