[sqlalchemy] activemapper runs into problems with particular import ordering

2006-11-03 Thread Craig Turner
I've just overcome a problem in a test app that's using activemapper. At the top, the imports were done like this: from sqlalchemy.ext.activemapper import * from sqlalchemy import * Running my script gave this error: $ python test.py Traceback (most recent call last): File test.py,

[sqlalchemy] Re: Mapping a graph data structure

2006-11-03 Thread Arnar Birgisson
On 11/1/06, Michael Bayer [EMAIL PROTECTED] wrote: im beginning to regret having viewonly and non_primary as options,since i cant think of anything they do that cant be better accomplishedjust by using Query.select(), or manual queries in conjunction with query.instances().I think im going to try

[sqlalchemy] serialization problem ?

2006-11-03 Thread Julien Cigar
Hello ! I'm running SQLAlchemy 0.2.8 with Python 2.4. I have the following : roles_table = Table('roles', meta, Column('id', Integer, primary_key=True, nullable=False), Column('name', String(100), nullable=False)) users_table = Table('users', meta, Column('id', Integer,

[sqlalchemy] Re: New Plugin - AssociationProxy

2006-11-03 Thread JP
This is really awesome. It would be even awesomer if append()/create() could optionally take keyword arguments that would be passed to the creator, so that the creator would be able to populate other association fields if it knows how. I'm thinking of something like: post.tags.append('awesomer',

[sqlalchemy] Re: Multilpe Table inheritance and relations

2006-11-03 Thread asrenzo
Since I'm really stupid, I have another problem which seems to be much to complex for my small brain. I'm performing some more tests with SA and I tried to add a self reference to a table which also is involved in inheritance. This is my example : employees = Table('employees', metadata,

[sqlalchemy] Re: Multilpe Table inheritance and relations

2006-11-03 Thread asrenzo
Ooops, My primaryjoin=employees.c.another_id==employees.c.person_id should be primaryjoin=employees.c.father_id==employees.c.person_id. This is just a typo. I really have this FlushError: Circular dependency detected --~--~-~--~~~---~--~~ You received this

[sqlalchemy] Re: Multilpe Table inheritance and relations

2006-11-03 Thread Michael Bayer
this error implies that two instances are dependent on each other, and cannot both be INSERTed whole. the postupdate flag is used to remedy this situation, which will issue a second UPDATE statement to associate the two rows together after they have been INSERTed. if thats not working, attach a

[sqlalchemy] Re: serialization problem ?

2006-11-03 Thread Michael Bayer
the fact that a User class has an attribute roles is due to the mapper placed on the User class, which initializes it with the roles attribute. if youre using mod_python, its likely using a multi-process model which can deserialize a User object into a new process where the owning module has not

[sqlalchemy] generating only SQL statements?

2006-11-03 Thread digimotif
All, I'm writing code that is using mappers for a database. I'm currently going in and creating objects based off of other objects that will then need to be deleted. (Meaning I'm adding records to tables based on other records that will be removed entirely). I'm wondering if there is already

[sqlalchemy] Error when changing two row values

2006-11-03 Thread Paul Nospam
I'm new to both python and SQLAlchemy, but am improving. I'm building a new application that will use a sqlite database. A unit test is failing with this exception: sqlalchemy.exceptions.ConcurrentModificationError: Updated rowcount 0 does not match number of objects updated 1 Below is a small

[sqlalchemy] Re: convert_unicode=True results in double encoding

2006-11-03 Thread Shannon -jj Behrens
On 11/3/06, Shannon -jj Behrens [EMAIL PROTECTED] wrote: I'm using convert_unicode=True. Everything is fine as long as I'm the one reading and writing the data. However, if I look at what's actually being stored in the database, it's like the data has been encoded twiced. If I switch to

[sqlalchemy] Re: single table inheritance questions

2006-11-03 Thread Randall Smith
Michael Bayer wrote: On Nov 2, 2006, at 11:47 PM, Randall Smith wrote: Is there a way to inherit more than one level for single table inheritance? Take this relationship for example: Animal - Dog - German Shepard Say there are 10 animals; 5 are dogs and 2 are German Shepard.