[Sqlalchemy-users] Dropping and Creating All Tables at Once

2006-04-23 Thread Koen Bok
Is there an easy way to drop all tables an recreate them at once? At this moment I do a tableobject.create() for each table. I searched the engine object for a list with registered table objects, but I could not find one. Also tableobject.drop() does not seem to drop my table sequences?

[Sqlalchemy-users] Documentation Format and Edits

2006-04-23 Thread Gambit
Hey All, and Mike in particular - I occasionally find things that I'd like to change in the documentation, such as adding Example N: Short Description Of Code Snippet to all the code blocks for easy both easy referencing and direct linking. I'm happy enough to do this, if someone cares to lay

Re: [Sqlalchemy-users] when is __init__() called?

2006-04-23 Thread Michael Bayer
well here is the funny thing, is that I was sure back in November that someone would soon mention this, and I'd have to look into some more elaborate way to call __new__ instead of __init__ etc., then some people might want it configurable, but here we are 6 months later and you are the

Re: [Sqlalchemy-users] Many to Many Relationship with ;secondaryjoin' Failing

2006-04-23 Thread Michael Bayer
you need the secondary table explicit in a many-to-many join: Information.mapper.add_property('datas', relation(Data.mapper, rel_table, primaryjoin=info_table.c.pk==rel_table.c.info_pk, secondaryjoin=rel_table.c.data_pk==data_table.c.pk)) On Apr 23, 2006, at 8:39 AM, Gambit

[Sqlalchemy-users] Compound foreign keys

2006-04-23 Thread Brad Clements
I have tables with compound primary keys, like this: # table task # Individual task for a service task = Table('task', Column('system_id', Integer, primary_key=True, nullable=False, ), Column('id', Integer,

Re[2]: [Sqlalchemy-users] Many to Many Relationship with ;secondaryjoin' Failing

2006-04-23 Thread Gambit
Hey Michael, So the docs will be updated with this, then? -G On Sunday, April 23, 2006, 5:54:33 PM, you wrote: you need the secondary table explicit in a many-to-many join: Information.mapper.add_property('datas', relation(Data.mapper, rel_table,

Re: Re[2]: [Sqlalchemy-users] Many to Many Relationship with ;secondaryjoin' Failing

2006-04-23 Thread Michael Bayer
gambit - this doc ? # define a mapper that does many-to-many on the 'itemkeywords' association # table Article.mapper = mapper(Article, articles, properties = dict( keywords = relation(mapper(Keyword, keywords), itemkeywords, lazy=False) ) ) itemkeywords is the

Re: [Sqlalchemy-users] Syncrule Not Generated?

2006-04-23 Thread Michael Bayer
a syncrule is an object generated internally when you associate one Mapper with another Mapper via a relation(), which is actually an object called a PropertyLoader. so lets use the Users/Address example. say we have classes User and Address. the join condition is

Re[4]: [Sqlalchemy-users] Many to Many Relationship with ;secondaryjoin' Failing

2006-04-23 Thread Gambit
Hey Mike, I was thinking more of this one: class User(object): pass class Keyword(object): pass Keyword.mapper = mapper(Keyword, keywords) User.mapper = mapper(User, users, properties={ 'keywords':relation(Keyword.mapper, primaryjoin=users.c.user_id==userkeywords.c.user_id,

Re[2]: [Sqlalchemy-users] Syncrule Not Generated?

2006-04-23 Thread Gambit
Hey Mike, Speaking from a debugging point of view, it might be useful if error messages get more text then just it failed, and died. Even if you just attached your paragraph at the bottom starting So when the... either to the error itself (always useful!) or somewhere in the docs (which,

[Sqlalchemy-users] Firebird compound key mapper get fails

2006-04-23 Thread Brad Clements
I am using svn update from today.. I am testing with Firebird engine, which I realize may be busted. However I just took a look at the MS-SQL engine and it does the same thing. I have a table with a compound key, like this: Tcontact = Table('contact', Column('system_id',

Re: Re[4]: [Sqlalchemy-users] question about convert_unicode

2006-04-23 Thread Jonathan Ellis
On 4/20/06, Michael Bayer [EMAIL PROTECTED] wrote: On Apr 20, 2006, at 2:18 PM, Vasily Sulatskov wrote: - may I suggest, that since this issue is decided completely within the source code for types.String, that various implementations of String, corresponding to different user preferences with

Re[4]: [Sqlalchemy-users] Syncrule Not Generated?

2006-04-23 Thread Gambit
Hey Mike, Yeah, I see the problem -- didn't mean it to come across as criticism of how things are! :) Personally, I'm a big fan of extreemly verbose error messages, with suggestions, sample code, or even usage cases when possible -- either in the error message itself or referenced by an error

Re: Re[4]: [Sqlalchemy-users] Syncrule Not Generated?

2006-04-23 Thread Michael Bayer
On Apr 23, 2006, at 7:59 PM, Gambit wrote: Maybe just having it note back to a specific place in the documentation for future suggestions, steps to repro and solve? yah thats great stuff.but im not in a hurry for things like that as its a huge amount of effort that can suddenly be

Re: [Sqlalchemy-users] Firebird compound key mapper get fails

2006-04-23 Thread Michael Bayer
your last stack trace there is still using the firebird module. On Apr 23, 2006, at 5:56 PM, Brad Clements wrote: I am using svn update from today.. I am testing with Firebird engine, which I realize may be busted. However I just took a look at the MS-SQL engine and it does the same

Re: [Sqlalchemy-users] Firebird compound key mapper get fails

2006-04-23 Thread Brad Clements
Michael Bayer wrote: your last stack trace there is still using the firebird module. yes it is. Sorry my phrasing was poor. I should have said, gee, now I get this error in Firebird, so I will now switch to ms-sql. --- Using Tomcat but