Re: [sqlalchemy] 0.6b1 - meta.create_all with FB

2010-02-05 Thread werner
On 05/02/2010 00:27, Michael Bayer wrote: On Feb 4, 2010, at 3:39 PM, werner wrote: OK i see the point about the constructor, though I want to get across that yes the constructor is optional with declarative, but you can still make one. Could the constructor be done in a

Re: [sqlalchemy] manytomany optimisations

2010-02-05 Thread Gaetan de Menten
On Thu, Feb 4, 2010 at 17:25, Andrew ajpere...@googlemail.com wrote: I have a table of tasks which contain references to multiple children and parents (tasks can have multiple children and multiple parents in this example). These are defined as ManyToMany and so I get an extra table

[sqlalchemy] AttributeError: 'MySQLCompiler' object has no attribute 'mapped_table'

2010-02-05 Thread Simone Orsi
Hi all, can anybody explain why this: session.query(Answer).all() - [Answer('...'), ... ] works, but this: session.query(func.sum(Answer.close_answer1)).all() throws the following error? *** AttributeError: 'MySQLCompiler' object has no attribute 'mapped_table' The class 'Answer' is mapped

Re: [sqlalchemy] AttributeError: 'MySQLCompiler' object has no attribute 'mapped_table'

2010-02-05 Thread Michael Bayer
Simone Orsi wrote: Hi all, can anybody explain why this: session.query(Answer).all() - [Answer('...'), ... ] works, but this: session.query(func.sum(Answer.close_answer1)).all() throws the following error? *** AttributeError: 'MySQLCompiler' object has no attribute 'mapped_table'

Re: [sqlalchemy] exceptions.TypeError: bad operand type for unary -: 'InstrumentedAttribute'

2010-02-05 Thread Michael Bayer
Chris Withers wrote: Hi All, When will InstrumentedAttribute support unary minus? Feels clunky having to write -1*field ;-) nobody ever asked. r6727. Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk -- You

Re: [sqlalchemy] exceptions.TypeError: bad operand type for unary -: 'InstrumentedAttribute'

2010-02-05 Thread Chris Withers
Michael Bayer wrote: Chris Withers wrote: Hi All, When will InstrumentedAttribute support unary minus? Feels clunky having to write -1*field ;-) nobody ever asked. r6727. Cool, thanks :-) When will r6727 land? 0.6 or 0.7? Chris -- Simplistix - Content Management, Batch Processing

Re: [sqlalchemy] exceptions.TypeError: bad operand type for unary -: 'InstrumentedAttribute'

2010-02-05 Thread Michael Bayer
Chris Withers wrote: Michael Bayer wrote: Chris Withers wrote: Hi All, When will InstrumentedAttribute support unary minus? Feels clunky having to write -1*field ;-) nobody ever asked. r6727. Cool, thanks :-) When will r6727 land? 0.6 or 0.7? 0.6beta2. Chris -- Simplistix -

Re: [sqlalchemy] AttributeError: 'MySQLCompiler' object has no attribute 'mapped_table'

2010-02-05 Thread Simone Orsi
Hi Michael, On 02/05/2010 04:16 PM, Michael Bayer wrote: Simone Orsi wrote: Hi all, can anybody explain why this: session.query(Answer).all() - [Answer('...'), ... ] works, but this: session.query(func.sum(Answer.close_answer1)).all() throws the following error? ***

[sqlalchemy] eagerload -- unknown column None in field list

2010-02-05 Thread diana
I only seem to get this error when I I try to eager load a child collection -- eager loading one child item works fine. I've tried: lazy=False on the relation as well as eagerload on the query: query.options(eagerload('foo')) but each time I get: (OperationalError) (1054, Unknown

Re: [sqlalchemy] eagerload -- unknown column None in field list

2010-02-05 Thread Michael Bayer
diana wrote: I only seem to get this error when I I try to eager load a child collection -- eager loading one child item works fine. I've tried: lazy=False on the relation as well as eagerload on the query: query.options(eagerload('foo')) but each time I get:

[sqlalchemy] SQLAlchemy with Central DB Shards

2010-02-05 Thread En Snare
I'm new to Python and am trying to get a sense of SQLAlchemy, particularly how to get it to work with our database infrastructure. I followed the Shard tutorial but didn't find it helpful for a beginner switching to this infrastructure. We have a central database that stores the locations of our

Re: [sqlalchemy] SQLAlchemy with Central DB Shards

2010-02-05 Thread En Snare
Hi Michael -- Thanks. I took a look through the code but am having trouble instantiating the database objects from within a class. Is there any sample code that shows how this is done? - En On Fri, Feb 5, 2010 at 4:13 PM, Michael Bayer mike...@zzzcomputing.com wrote: En Snare wrote: I'm new

Re: [sqlalchemy] SQLAlchemy with Central DB Shards

2010-02-05 Thread En Snare
This is my current code with the error I keep receiving: class Central(): def __init__(self,id): self.db = create_engine('sqlite:Users/adam/topic/central.db') self.db.echo = False self.metadata = MetaData(self.db) self.session =

[sqlalchemy] Re: 0.6b1 and pymssql

2010-02-05 Thread Domingo Aguilera
After r6731 File /home/smartics/myenv/src/sqlalchemy/lib/sqlalchemy/engine/ __init__.py, line 223, in create_engine return strategy.create(*args, **kwargs) File /home/smartics/myenv/src/sqlalchemy/lib/sqlalchemy/engine/ strategies.py, line 65, in create dialect =

Re: [sqlalchemy] Re: 0.6b1 and pymssql

2010-02-05 Thread Michael Bayer
On Feb 5, 2010, at 10:18 PM, Domingo Aguilera wrote: After r6731 File /home/smartics/myenv/src/sqlalchemy/lib/sqlalchemy/engine/ __init__.py, line 223, in create_engine return strategy.create(*args, **kwargs) File /home/smartics/myenv/src/sqlalchemy/lib/sqlalchemy/engine/

[sqlalchemy] PG8000 UnicodeDecodeError

2010-02-05 Thread Kevin Ar18
So, I'm using PG8000 1.07 and SqlAlchemy 0.6beta1dev_r6718 and I get this error: UnicodeDecodeError: 'ascii' codec can't decode byte 0x8d in position 3: ordinal not in range(128) I saw a past message about this same thing that said to use a newer version of PG8000 Well, as far as I can tell,