> -----Original Message-----
> From: sqlalchemy@googlegroups.com 
> [mailto:sqlalch...@googlegroups.com] On Behalf Of Randy Syring
> Sent: 23 July 2009 07:23
> To: sqlalchemy
> Subject: [sqlalchemy] Re: autoload of db view treating 
> columns as Decimal
> 
> 
> Well, I am not really sure what the problem is, but it looks like it
> might not have anything to do with the autoload.  I tried just using a
> select statement with a from_obj parameter and it looks to me like SA
> is getting things wrong when it looks for the field name.  Here is the
> script i used:
> 
> http://paste.pocoo.org/show/130239/
> 
> Here is the key:value pairs for each row/column when trying to select
> from an sqlite view that uses a case statement:
> row 0
>     id: 1
>     name: jack
>     'something': something
>     case
>             when name == 'jack' then 1
>             else 0
>         end: 1
> row 1
>     id: 2
>     name: sam
>     'something': something
>     case
>             when name == 'jack' then 1
>             else 0
>         end: 0
> 
> The same test running against Postgres is:
> 
> row 0
>     id: 1
>     name: jack
>     staticfield: something
>     isjack: 1
> row 1
>     id: 2
>     name: sam
>     staticfield: something
>     isjack: 0
> 
> 

When I run your script, I get the correct output, using Python 2.5.1, SA
0.5.4p2, sqlite3 version 2.3.2. Perhaps the bug is in the version of
SQLite that you are using?

What happens if you run your query using the SQLite command-line tools?

Simon

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

Reply via email to