[Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-17 Thread dmiller
Add this test case to LazyTest in test/orm/lazytest1.py def test_lazy_backref(self): class Information(object): pass class Relation(object): pass session = create_session() mapper(Relation, rel_table)

Re: [Sqlalchemy-users] schema consideration for FK in table.create()

2006-07-17 Thread Randall Smith
I installed 0.2.4 and it worked properly. Then I installed 0.2.5 and it worked properly also, so I'm not sure what caused the problem now. I'll post back if I do figure it out. Randall Randall Smith wrote: The following was done with SVN trunk 1712. I have a table defined as such:

[Sqlalchemy-users] activemapper schema assignment

2006-07-17 Thread Randall Smith
Is there a way to assign a schema name using activemapper in the same way a table is created like (tablename, metadata, cols, schema=schemaname)? Randall - Take Surveys. Earn Cash. Influence the Future of IT Join

Re: [Sqlalchemy-users] Set backref attribute on lazy relationship

2006-07-17 Thread Michael Bayer
saying : rel.info = info implies that you are also saying: info.rels.append(rel) since info is saved to the database, and therefore can have any number of Relation objects already in its rels collection, how might SA properly append to the list without first lazily

Re: [Sqlalchemy-users] Mixing metaphors

2006-07-17 Thread Michael Bayer
to do begin/commit via straight SQL, use: connection = dbEngine.connect() trans = connection.begin() connection.execute(update table set name='bar') trans.commit() using the textual BEGIN and COMMIT is not going to be portable with DBAPI and might not even work

[Sqlalchemy-users] mapper extension before_insert / before_update busted

2006-07-17 Thread Brad Clements
Revision: 1712 (first time I've tried this so I don't know if it's recent breakage) Tcontact = Table('contact' ... ) class contact(object): pass assign_mapper(contact, Tcontact, extension=[ table_extensions.contact(), ]) in table_extensions.py: class

Re: [Sqlalchemy-users] Using reserved key word as table name

2006-07-17 Thread Michael Bayer
this falls within ticket #155 for the moment, ill see if i can bump it up as quoting is getting to be a hot issue. On Jul 16, 2006, at 4:00 AM, Yuan HOng wrote: I happen to have a table named 'order' which coincides with the SQL reserved keyword. This leads to an error when I use sqlalchemy

Re: [Sqlalchemy-users] Can't locate property when setting getter/setter functions on an attribute

2006-07-17 Thread Jamie Wilkinson
This one time, at band camp, Michael Bayer wrote: _hash is the name of the property now. query like this: results = session.query(PropertyClass).select_by(_hash=a b) Oh, I see! That's a bit... well it feels dirty because now the application using the model needs to know a bit more about

Re: [Sqlalchemy-users] mapper extension before_insert / before_update busted

2006-07-17 Thread Brad Clements
On 17 Jul 2006 at 21:08, Michael Bayer wrote: its working on this end, i see you are using assign_mapper without a sessioncontext so i guess that means you are on threadlocal, tried that too (which does add its own extension in) but it also works. see if you can attach a test

Re: [Sqlalchemy-users] How to find out which object causes an exception

2006-07-17 Thread Yuan HOng
Using echo=True can be helpful for programmers in identifying what happened. But for a program to to so can be difficult. It is also difficult to add all check conditions and constraints current programmed as foreign keys, triggers etc. in the database itself. Since the database can be accessed