[sqlalchemy] Re: select() vs. self.session.query(): no group_by, different params?

2007-05-03 Thread Glauco
Michael Bayer ha scritto: On May 2, 2007, at 11:23 AM, Glauco wrote: Example: create table people ( name text, surname text, type CASE 'A','B','C' ) There is no solution to do for example the simple query based over the mapper People: select count(type) from people group by

[sqlalchemy] Correct use of PropertyLoader

2007-05-03 Thread Glauco
I want to create a correct mapper with property from a dict. ;-O The dict information can come to me via a Form or a web Services or a file, so i must create from nothing a mapper with his property too for the insert into Example: assign_mapper(context, MainTable,

[sqlalchemy] Re: Problems Inserting into Oracle using Bind Variables from Turbo Gears Controller

2007-05-03 Thread shday
I'm getting this error even though I have convert_unicode = True and the proper NLS_LANG setting: SQLError: (NotSupportedError) Variable_TypeByValue(): unhandled data type unicode 'DELETE FROM model_acc_protocol WHERE model_acc_protocol.model_id = :model_id AND model_acc_protocol.acc_protocol_id

[sqlalchemy] Re: Problems Inserting into Oracle using Bind Variables from Turbo Gears Controller

2007-05-03 Thread Michael Bayer
On May 3, 2007, at 11:25 AM, shday wrote: I'm getting this error even though I have convert_unicode = True and the proper NLS_LANG setting: SQLError: (NotSupportedError) Variable_TypeByValue(): unhandled data type unicode 'DELETE FROM model_acc_protocol WHERE model_acc_protocol.model_id

[sqlalchemy] Re: Problems Inserting into Oracle using Bind Variables from Turbo Gears Controller

2007-05-03 Thread shday
The problem seems to be related to a backref I had. I found a way without using backref and now things work. With this I get a unicode error: acc_mapper =

[sqlalchemy] Re: Problems Inserting into Oracle using Bind Variables from Turbo Gears Controller

2007-05-03 Thread Michael Bayer
On May 3, 2007, at 2:41 PM, shday wrote: The problem seems to be related to a backref I had. I found a way without using backref and now things work. With this I get a unicode error: acc_mapper = mapper(ACCProtocolSpecies,acc_protocol_species_table,properties= {'models':relation

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Kirk Strauser
On May 2, 2007, at 8:32 PM, Michael Bayer wrote: oh duh, i forgot about the new thing Gaetan came up with, try this too: mapper(Invoice, invoice_table, properties={ 'customer':column_property(func.substr(invoice_table.c.invnum, 1, 4).label('customer')) }) That's so very, *very*

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Michael Bayer
On May 3, 2007, at 5:29 PM, Kirk Strauser wrote: The killer part is the (substring(rdy2bill.xmlvars, %(substring)s) AS groupcode = in the WHERE clause. PostgreSQL apparently doesn't want that predicate to be named. Can that be disabled? -- not really (well yes, you can take the

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Michael Bayer
no wait, scratch my last email for a bit. try rev 2601. On May 3, 2007, at 5:29 PM, Kirk Strauser wrote: On May 2, 2007, at 8:32 PM, Michael Bayer wrote: oh duh, i forgot about the new thing Gaetan came up with, try this too: mapper(Invoice, invoice_table, properties={

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Kirk Strauser
On May 3, 2007, at 5:18 PM, Michael Bayer wrote: not really (well yes, you can take the label off, but then you dont get it in your columns clause, so that will break). mapping to the select statement that includes the column is the more general solution here (also allows the function

[sqlalchemy] Re: Queries on computed properties

2007-05-03 Thread Kirk Strauser
On May 3, 2007, at 5:31 PM, Michael Bayer wrote: no wait, scratch my last email for a bit. try rev 2601. Perfect! That was exactly what it needed. I have to say that after using SQLAlchemy for about a week, I'm really excited about this. -- Kirk Strauser

[sqlalchemy] Re: sqlalchemy introspection How?

2007-05-03 Thread Michael Bayer
On Apr 28, 2007, at 12:00 PM, johnny wrote: What I was trying to get was, there isn't a python command line option, that will create Object Mapper Classes for the tables, so I can import them within my applications. I guess, I have to code these every time I need to use a certain table