[SQLObject] Saving a rol with a derivative atribute
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Georgio B. <geo...@gm...> - 2013-09-11 13:25:53
|
Hello all.
I would like to know if it is possible to create a model class with a
default attribute derived from another.
An example:
class Post(SQLObject):
*title = StringCol()*
content = StringCol()
create_time = DateTimeCol(default=datetime.now)
tags = RelatedJoin('Tag')
author = ForeignKey('Author')
*slug = StringCol(default=title.replace(" ", "-"))*
Thank you very much.
|