I've asked two questions:

1) Why do I get back an Object reference, when the docs say it's a
query set?
2) How can I dump that object's values into a list instead of
iterating each column?


On Apr 21, 5:06 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Thursday, April 21, 2011 9:17:54 PM UTC+1, octopusgrabbus wrote:
>
> > I posted in the original problem.
> > cs_hold_rec_list = CsInvHold.objects.filter(inventory_ok=0)
>
> How is that a problem? What's wrong with it?
>
>
>
> > Right now, I can get what I need by doing this:
>
> >       qs = CsInvHold.objects.filter(inventory_ok=0)
> >        if qs:
> >            cs_list.append(['','Customer Synch Data On Hold Due To
> > Missing From AMR Inventory', ''])
> >            cs_list.append(['PremiseID', 'Endpoint ID', 'Date
> > Entered'])
>
> >            for each_q in qs:
> >                cs_list.append([str(each_q.premiseid),
> > int(each_q.endpointid), str(each_q.last_update)])
>
> > I want to get the entire result set without iteration through the
> > columns.
>
> What does that mean?
> You iterate through the members of the queryset, not the columns. Then you
> append a list consisting of various elements from each field in that member.
> What is wrong with this? What do you actually want to achieve and in what
> way does this not fulfill your requirement?
>
> > In addition from what I read in the documentation, I was supposed to
> > get a QuerySet returned on a filter, not a model object reference.
> > I'm not sure why this is happening.
>
> Why *what* is happening?

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

Reply via email to