Last active
December 15, 2015 19:09
-
-
Save adiroiban/5308783 to your computer and use it in GitHub Desktop.
Describe an object persisted in DB using interfaces and schema.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IDBEventEntry(IDBTable): | |
message_id = schema.db.Integer(name='event_id', description='Some docstring here', lenght=12) | |
class DBObject(TwistarDBObject): | |
def getColums(): | |
""" | |
Return all db columns. | |
""" | |
dev validateSchama(): | |
""" | |
return a deferred with return None if everthing is ok | |
raise an DBValidationError if things go wrong. | |
""" | |
DBEventEntru(DBObject): | |
implements(IDBEventEntry) | |
def __init__(self): | |
self.message_id = 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment