Re: [Sqlalchemy-users] How to create index

2006-01-04 Thread limodou
2006/1/5, Michael Bayer <[EMAIL PROTECTED]>: > > On Jan 4, 2006, at 11:38 PM, limodou wrote: > > > > > engine.execute('CREATE INDEX idxName ON tblName (col1, col2)', ()) > > > > can the second parameter be default () or {}? > > > > at the moment, this method feeds the statement and params directly

Re: [Sqlalchemy-users] How to create index

2006-01-04 Thread Michael Bayer
On Jan 4, 2006, at 11:38 PM, limodou wrote: engine.execute('CREATE INDEX idxName ON tblName (col1, col2)', ()) can the second parameter be default () or {}? at the moment, this method feeds the statement and params directly to the execute() method on a dbapi cursor. So its specific to t

[Sqlalchemy-users] easy create user-defined class

2006-01-04 Thread limodou
I'v written a help function to auto create a class, and predefined a __init__ function, and auto assign_mapper to a table metadata: def assign_class(class_name, table, **kwargs): import new class_ = new.classobj(class_name, (object,), {}) def __init__(self, **kwargs): for key,

Re: [Sqlalchemy-users] How to create index

2006-01-04 Thread limodou
2006/1/5, Robert Leftwich <[EMAIL PROTECTED]>: > limodou wrote: > > I want to know how to create index, need I create it using db-api > > cursor to do that? > > > > engine.execute('CREATE INDEX idxName ON tblName (col1, col2)') > > works for me. > I found that the execute method need at least two

Re: [Sqlalchemy-users] How to create index

2006-01-04 Thread Michael Bayer
theres talk about having an Index object for this, but its right on the edge of what really belongs in a python relational/ORM package since its not directly used except for creates. On Jan 4, 2006, at 9:19 PM, limodou wrote: 2006/1/5, Robert Leftwich <[EMAIL PROTECTED]>: limodou wrote: I

Re: [Sqlalchemy-users] self-joins, namespace schemas

2006-01-04 Thread Michael Bayer
thanks for the patch, I will look into checking it in tonight with a few tweaks. The error you are getting has to do with the fact that the syntax: relation(class, table, **keyword_args) will always create a brand new mapper on the given class/table combination. So in effect you ar

Re: [Sqlalchemy-users] How to create index

2006-01-04 Thread limodou
2006/1/5, Robert Leftwich <[EMAIL PROTECTED]>: > limodou wrote: > > I want to know how to create index, need I create it using db-api > > cursor to do that? > > > > engine.execute('CREATE INDEX idxName ON tblName (col1, col2)') > > works for me. > Thanks. -- I like python! My Blog: http://www.don

Re: [Sqlalchemy-users] How to create index

2006-01-04 Thread Robert Leftwich
limodou wrote: I want to know how to create index, need I create it using db-api cursor to do that? engine.execute('CREATE INDEX idxName ON tblName (col1, col2)') works for me. Robert --- This SF.net email is sponsored by: Splunk Inc. Do

[Sqlalchemy-users] How to create index

2006-01-04 Thread limodou
I want to know how to create index, need I create it using db-api cursor to do that? -- I like python! My Blog: http://www.donews.net/limodou NewEdit Maillist: http://groups.google.com/group/NewEdit --- This SF.net email is sponsored by: Splunk

[Sqlalchemy-users] self-joins, namespace schemas

2006-01-04 Thread daishi
Hi, I'm wondering if someone could provide an example of "self-joins" via the ORM/mapper? I'm attaching a code sample to illustrate what I've tried below. The current error that I get is: Non-primary property created for attribute 'parent2o' on class 'Subject', but that attribute is not manage