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

2006-04-23 Thread Michael Bayer
someone posted a new version of firebird which he says works, its in the comments for this ticket: http://www.sqlalchemy.org/trac/ticket/94 On Apr 23, 2006, at 9:13 PM, Brad Clements wrote: Michael Bayer wrote: your last stack trace there is still using the firebird module. yes it is. So

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

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 thing.

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 wa

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 num

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 preference

[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', Intege

[Sqlalchemy-users] ActiveMapper update

2006-04-23 Thread Jonathan LaCour
I slogged through ActiveMapper today, as I had a spare hour. I haven't done all that I wanted by a longshot, but I did accomplish some things. Here is the commit message for those who care: Got the unit tests running again, apart from the two that were not working in the first place

Re: [Sqlalchemy-users] intro to the 0.2 series

2006-04-23 Thread Michael Bayer
On Apr 22, 2006, at 2:39 PM, Daniel Miller wrote: # test create_metaclass context = ThreadLocalSessionContext(objectstore.Session) meta = create_metaclass(context) class MyClass(object): __metaclass__ = meta run_test(MyClass, context) how about this: import sqlal

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

2006-04-23 Thread Michael Bayer
hey gambit - a cohesive error message begins as what it literally is before it can be refined into a more descriptive case, based on observation of what actually makes it occur. when i wrote that message, i had no idea what conditions would create it. now we are getting a better idea so

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

2006-04-23 Thread Michael Bayer
hey tim - turns out that was pretty easy. i will make __new__ the default methodology in 0.2. for 0.1, I have added a keyword option to mapper() in revision 1321 of the trunk "construct_new=True", which will cause the Mapper to instantiate loaded instances using the __new__ method of the

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

2006-04-23 Thread Michael Bayer
ah yes, thats busted. On Apr 23, 2006, at 4:07 PM, Gambit wrote: 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.ma

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, docs

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: [Sqlalchemy-users] Compound foreign keys

2006-04-23 Thread Michael Bayer
On Apr 23, 2006, at 12:23 PM, Brad Clements wrote: primaryjoin = and_(sub_task.c.task = task.c.id, sub_task.c.system_id = task.c.system_id) yeah thats the idea. Or is there an easier way to do this in meta data, perhaps Table accepting some kind of Relationship object? how is tha

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 users.c.user_id==addr

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 secon

[Sqlalchemy-users] Syncrule Not Generated?

2006-04-23 Thread Gambit
Hey All, For the line: Customer.mapper.add_property('checkout_history', relation(CheckoutEntry.mapper, t_customer_tours, primaryjoin=Customer.c.cust_id==CustomerTour.c.cust_id, secondaryjoin=and_(CustomerTour.c.start_date <= CheckoutEntry.c.ts_checkout,

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, > primaryjoin=info_table.c.pk==

[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, Sequence(optional=True)

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, Gambi

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 fir

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

2006-04-23 Thread Michael Bayer
theres a ticket for this, with a terrific patch included that I have not had time to integrate (particularly with 0.2): http://www.sqlalchemy.org/trac/ticket/98 i hope to get around to this as soon as 0.2 is more or less running. On Apr 23, 2006, at 6:01 AM, Koen Bok wrote: Is there an easy

[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 : 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 ou

[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 .create() for each table. I searched the engine object for a list with registered table objects, but I could not find one. Also .drop() does not seem to drop my table sequences? Is this on purpose? T