Hi!
How can I set default for parent field?
class DB_Object(Base):
__tablename__ = 'objects'
id = Column(Integer, primary_key=True)
name = Column(String(50), unique=True, nullable=False)
type = Column(String(50))
__mapper_args__ = { 'polymorphic_identity': 'object', 'polymorphic_on':
type }
class Command(DB_Object):
__tablename__ = "commands"
id = Column(Integer, ForeignKey('objects.id'), primary_key=True)
name = Column(String(50), default="Command")
If I try to commit Command object
I have "objects.name may not be NULL"
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.