Andrew wrote:
>
> On Sep 30, 4:31 pm, "Michael Bayer" <[email protected]> wrote:
>> Andrew wrote:
>>
>> > I also went ahead and checked the raw output of query.all()--it worked
>> > correctly; all the IDs were retrieved and displayed in raw format:
>> > "Decimal(###)" and so on.  HOWEVER, when parsing those rows using a
>> > simple for loop, a'la
>>
>> >         str = ""
>> >         for row in query.all():
>> >             if row.sync_session_sid == None:
>> >                 str = str + "None<br>\n"
>> >             else:
>> >                 str = str + "%d<br>\n" % row.sync_session_sid
>>
>> >         return str
>>
>> > Which then returns:
>>
>> >     468811
>> >     None
>> >     468721
>>
>> > In other words, the *raw data* that it returns is good.  The mapping
>> > to objects is not.
>>
>> query.all() returns a list of tuples (well, an ad-hoc subclass of tuple
>> that provides the named attributes).   if query.all() is correct, then
>> it's correct.   I notice you are comparing to None using "==".  What
>> happens if you change that to "is"?
>
> Same exact result. :(
>
>     468811
>     None
>     468721

OK can you try poking a little deeper ?  you say "query.all()" is correct
and a simple loop breaks it ?  can you pls look at the repr() of the
result, do some pdb, etc., if "query.all()" is correct then there's only
something trivial going on.   its a list of tuples.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to