I aam having an issue defining a 2nd foreign key constraint on 2
derived classes of a base class that uses a self referential join.
Base class:ContentBase
class ContentBase(Base):
__tablename__ = 'content'
__mapper_args__ = {'polymorphic_on': ctype,
'polymorphic_identity':'contentbase'}
. It is however strange that the latter worked fine for
almost a year until I added a the 2nd FK in the derived classes
On 8 feb, 16:44, Michael Bayer mike...@zzzcomputing.com wrote:
On Feb 8, 2012, at 9:39 AM, cropr wrote:
I aam having an issue defining a 2nd foreign key constraint on 2
derived
I am trying to add a Column definition using a metaclass but things
aren't working as expected
I am using something like the code below
class MyMeta(DeclarativeMeta):
def __init__(cls, name, bases, attrdict):
setattr(cls, 'title', Column(types.String(80))
thanks, that was it I looking for
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+unsubscr...@googlegroups.com.
For more
I have defined a self refential class ContentObject to build a node
tree wih parent child relationships.
class ContentObject(Base):
__tablename__ = 'contentobject'
_contentType = 'contentobject'
id = Column(types.Integer, primary_key=True, autoincrement=True)
parent_id =
Indeed this solves the issue
Tnx
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL
Does somebody know if is possible to use a declarative class
definition for the schema below
content = Table('content', meta.metadata,
Column('id', types.Integer, primary_key=True, autoincrement=True),
Column('title', types.String(80)),
Column('parent_id', types.Integer,
I want to build a relation to a class located in a different file
file user.py
---
class Users(Base):
__tablename__ = 'users'
username = Column(types.String(32), primary_key=True)
password = Column(types.String(32))
file content.py
---
from user import