[sqlalchemy] Re: Problems trying to run a query - typeerror

2007-06-11 Thread Michael Bayer
SQLAlchemy doesnt expect your class to have customizations going on with __new__(). either fix your __new__() method to require only the cls argument, or create a MapperExtension that provides the create_instance() method, so that you create new instances yourself:

[sqlalchemy] multiple mappers on une table problem.

2007-06-11 Thread Glauco
Hi Folk, I'm finding difficult implement this features of SA . The example is: a simple table with a column type. I want to do a secondary mapper based on the primary mapper with the only different in the column type='something' create table person( name text, type text); class

[sqlalchemy] SQLError.... label Error

2007-06-11 Thread Glauco
I use hardly the column prefix, so my query are always aliased. this obviously cause a lot of problem whith the order_by clause (that NOT use the same aliases) Is there some solution or mus wait for the new relase? This is a tipical Example ... the anagrafica.nome ORDER_BY column

[sqlalchemy] Re: SQLError.... label Error

2007-06-11 Thread Michael Bayer
On Jun 11, 2007, at 11:19 AM, Glauco wrote: I use hardly the column prefix, so my query are always aliased. this obviously cause a lot of problem whith the order_by clause (that NOT use the same aliases) the approach here depends on how this query is being constructed. if you are

[sqlalchemy] Re: multiple mappers on une table problem.

2007-06-11 Thread Michael Bayer
On Jun 11, 2007, at 11:12 AM, Glauco wrote: This cause a lot of inspiegable problem to property that are perfecly functional in the primary sqlalchemy.exceptions.ArgumentError: Can't determine relation direction for relationship 'Blabla.comune_nascita (Comune)' - foreign key columns

[sqlalchemy] Re: SQLError.... label Error

2007-06-11 Thread Glauco
Michael Bayer ha scritto: On Jun 11, 2007, at 11:19 AM, Glauco wrote: I use hardly the column prefix, so my query are always aliased. this obviously cause a lot of problem whith the order_by clause (that NOT use the same aliases) the approach here depends on how this query

[sqlalchemy] Re: multiple mappers on une table problem.

2007-06-11 Thread Glauco
Michael Bayer ha scritto: On Jun 11, 2007, at 11:12 AM, Glauco wrote: This cause a lot of inspiegable problem to property that are perfecly functional in the primary sqlalchemy.exceptions.ArgumentError: Can't determine relation direction for relationship 'Blabla.comune_nascita

[sqlalchemy] Re: SQLError.... label Error

2007-06-11 Thread Michael Bayer
On Jun 11, 2007, at 12:14 PM, Glauco wrote: my problem is exactly this... i don't use aliases, and the example is a qru constructed by SA. you can only order by tables that you have added to the query explicitly or via join(). you cant order by columns that are added by eager

[sqlalchemy] Re: multiple mappers on une table problem.

2007-06-11 Thread Michael Bayer
On Jun 11, 2007, at 12:21 PM, Glauco wrote: For this reason i've inserted explicit primaryjoin condition, and these condition work perfectly in the primary mapper. But in the secondary wont work... theres many reasons why you probably dont want to do what youre trying to do. first

[sqlalchemy] Re: [MySQL] Checking if commit() is available

2007-06-11 Thread Monty Taylor
Michael Bayer wrote: On Jun 8, 2007, at 2:17 PM, Andreas Jung wrote: --On 8. Juni 2007 14:05:39 -0400 Rick Morrison [EMAIL PROTECTED] wrote: try: t.commit() except: print 'Holy cow, this database is lame' This code is also lame :-) The code should work for arbitrary

[sqlalchemy] PYTZ and SA

2007-06-11 Thread Michael Carter
Hello, I was having some issues using pytz (python timezone definitions) with sqlalchemy. Before I post the specifics of my problem, I'm curious if there is any documentation on this kind of thing or If anyone else here had tried it before. Thanks, Michael Carter