[sqlalchemy] Re: @compiles ignores inheritance

2010-03-31 Thread Tobias
Great! Thanks a lot, Michael. On Mar 30, 4:42 pm, Michael Bayer mike...@zzzcomputing.com wrote: Tobias wrote: Hi, So I thought I could write just one method, that is annotated with @compiles(__base_function), but this does not work. I have to write a method for each class that

[sqlalchemy] where clause construction using variable names and values

2010-03-31 Thread Tejaswi
I have a dict of keys to values which have to go into my where clause with an and_. Say dict = {key1: value1, key2: value2} my select statement should look like select * from blah where key1 = value1 and key2 = value2 I know this has to do with constructing the right where clause element, but I

Re: [sqlalchemy] where clause construction using variable names and values

2010-03-31 Thread Conor
Tejaswi wrote: I have a dict of keys to values which have to go into my where clause with an and_. Say dict = {key1: value1, key2: value2} my select statement should look like select * from blah where key1 = value1 and key2 = value2 I know this has to do with constructing the right where

Re: [sqlalchemy] where clause construction using variable names and values

2010-03-31 Thread werner
On 31/03/2010 08:19, Tejaswi wrote: I have a dict of keys to values which have to go into my where clause with an and_. Say dict = {key1: value1, key2: value2} my select statement should look like select * from blah where key1 = value1 and key2 = value2 I know this has to do with constructing

[sqlalchemy] Re: where clause construction using variable names and values

2010-03-31 Thread Tejaswi
I am not using sa.orm. I want to use only the sql expression syntax. @Conor: I tried the dict approach. The problem is, I don't know how many key value pairs I will have. I will have to use a map, or map* to construct the full set of where clauses. This is the syntax I am not able to figure out.

Re: [sqlalchemy] Re: where clause construction using variable names and values

2010-03-31 Thread Conor
Tejaswi wrote: I am not using sa.orm. I want to use only the sql expression syntax. @Conor: I tried the dict approach. The problem is, I don't know how many key value pairs I will have. I will have to use a map, or map* to construct the full set of where clauses. This is the syntax I am not

[sqlalchemy] Re: where clause construction using variable names and values

2010-03-31 Thread Tejaswi
@Conor: This might be what I am looking for. I cannot try it right now, but will reply to this thread in 3-4 hours. Can you please point me to the documentation that discusses the different ways of constructing select statements, where clauses, etc. I have not seen the generative way before. I

[sqlalchemy] Re: where clause construction using variable names and values

2010-03-31 Thread Tejaswi
On second thought, it's nothing to do with SA, and just a python feature that I am not familiar with. The idiom of clause construction, and passing arguments using the *list is new to me. And most of my Google queries were prefixed with sqlalchemy, and in retrospect, that was hurting more than

[sqlalchemy] sqlalchemy reflection

2010-03-31 Thread Tan Yi
quick question: for sqlalchemy+ms sql server, what kind of accessibility does it need to do table reflection? What I am trying to do is that I try to reflect a table from an existing database, and I successfully created an engine. But I got following exception: raise exc.DBAPIError.instance(None,

[sqlalchemy] Upgraded to 0.6beta3, getting a lot of SAWarning: Unicode type received non-unicode bind param

2010-03-31 Thread Peteris Krumins
Hi all, I upgraded to SA 0.6beta3 and suddenly I am getting a lot of SAWarning: Unicode type received non-unicode bind param value warnings for the code that worked OK on 0.5.x. The warnings occur even for values that are plain ascii (no code points above 127). Does it mean I'll have to make

[sqlalchemy] Re: where clause construction using variable names and values

2010-03-31 Thread Tejaswi
@Conor - the where clause construction works now. Thanks for the reply on that. I have run into a new problem now. My select clauses have unicode names even when I construct them from vanilla strings. Here's my code: column_list = [url, 'html'] what_fields = [meta.c[x] for x in column_list] print

Re: [sqlalchemy] Upgraded to 0.6beta3, getting a lot of SAWarning: Unicode type received non-unicode bind param

2010-03-31 Thread Michael Bayer
would have to see how you've set things up in order for that to occur. If you use the Unicode type with default settings, the behavior is the same on 0.5 and 0.6 - Python unicodes are expected and a warning is emitted otherwise. With String,VARCHAR, CHAR, etc., this is not the case and plain