[sqlalchemy] Re: difficult error from Base.metadata.create_all(engine)

2011-04-03 Thread farcat
OK, after a long day of experimentation ... I found a solution. This is the new code (compare to old copied in above): -- class tablemeta(DeclarativeMeta): def __new__(mcls, typedef): return

Re: [sqlalchemy] Re: difficult error from Base.metadata.create_all(engine)

2011-04-03 Thread Michael Bayer
On Apr 3, 2011, at 11:50 AM, farcat wrote: The problem seemed to be in the order of adding relationships. The main difference is that now i call DeclarativeMeta.__init__ before adding relationships. Even using a dict with relationship attributes as last argument to __init__ did not work.(

[sqlalchemy] Re: difficult error from Base.metadata.create_all(engine)

2011-04-03 Thread farcat
Hi Michael, Could cls.links.member_name == mem.name have been the problem? mem.name is just a string. cls and cls.links are classes/tables (links is just an extra attribute in cls). Regards, Lars Ce On Apr 3, 6:53 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Apr 3, 2011, at 11:50 AM,

[sqlalchemy] Re: difficult error from Base.metadata.create_all(engine)

2011-04-02 Thread farcat
He Michael, You saved me again .. Thanks! On Apr 2, 2:09 am, Michael Bayer mike...@zzzcomputing.com wrote: On Apr 1, 2011, at 2:52 PM, farcat wrote: Hi Michael, Still stuck, I don't mixin foreign keys or relationships. When is a Column attached to a table in declarative? so you have a

[sqlalchemy] Re: difficult error from Base.metadata.create_all(engine)

2011-04-02 Thread farcat
Hello, I get the following error: ___ Traceback (most recent call last): File D:\Documents\Code\Eclipse\workspace\SQLAtest\data.py, line 29, in module I1 = reg[integer](integer = 5321) File string, line 4, in __init__ File

[sqlalchemy] Re: difficult error from Base.metadata.create_all(engine)

2011-04-01 Thread farcat
Hi Michael, Still stuck, I don't mixin foreign keys or relationships. When is a Column attached to a table in declarative? My code is: import datetime from datatypes import * from accessors import member_accessor, reference_accessor from sqlalchemy import * from sqlalchemy.orm import

Re: [sqlalchemy] Re: difficult error from Base.metadata.create_all(engine)

2011-04-01 Thread Michael Bayer
On Apr 1, 2011, at 2:52 PM, farcat wrote: Hi Michael, Still stuck, I don't mixin foreign keys or relationships. When is a Column attached to a table in declarative? so you have a few things like: class AtomBase(BaseBase): id = Column(Integer, primary_key=True) where AtomBase does