Hi all,
I'm stucked with a problem I'm not able to solve (SA 0.5.2). I hope on
of you would be smarter than me.
Here is the problem:
"""""""""""""""""""""""""""""""""""""""
import sqlalchemy as sa
__metadata__ = sa.MetaData()
OBJECTS = sa.Table('objects', __metadata__,
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('parent_id', sa.ForeignKey('objects.id',
ondelete='CASCADE', onupdate='CASCADE')),
sa.Column('name', sa.Text, index=True, nullable=False, default='Root'),
)
OBJECTSTREE = sa.Table('objects_tree', __metadata__,
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('child_id', sa.ForeignKey('objects.id',
ondelete='CASCADE', onupdate='CASCADE'), primary_key=True),
sa.Column('parent_id', sa.ForeignKey('objects.parent_id',
ondelete='CASCADE', onupdate='CASCADE'), primary_key=True),
sa.Column('depth', sa.Integer, nullable=False, index=True, default=0),
)
When I call the create_all() method from metadata, I always get this
error -> sqlalchemy/types.py", line 375, in get_col_spec raise
NotImplementedError()
I sounds that my parent_id column from table objects_tree can not be
created because it's a ForeignKey on another ForeignKey.
When I use plain SQL on my pgsql shell, everything is OK.
Does anybody have any clue ?
Regards,
Laurent
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---