class ScanResult(Model): tablename = 'ScanResults' belongs_to({'scan': 'Scan'}) has_many({'x_results': 'XResultRow'}) x = Field.text() y = Field.text() z = Field.text() f = Field.text() e = Field.text(auto_validation=False) s = Field.blob()
class Comment(Model): belongs_to('user', 'post') text = Field.text() date = Field.datetime() default_values = {'user': lambda: session.auth.user.id, 'date': now} validation = {'text': {'presence': True}} fields_rw = {'user': False, 'post': False, 'date': False}
class Post(Model): belongs_to('user') has_many('comments') title = Field() text = Field.text() date = Field.datetime() default_values = {'user': lambda: session.auth.user.id, 'date': now} validation = {'title': {'presence': True}, 'text': {'presence': True}} fields_rw = {'user': False, 'date': False}
class A(Model): tablename = "a" name = Field() val = Field.int() fval = Field.float() text = Field.text() password = Field.password() d = Field.date() t = Field.time() dt = Field.datetime() json = Field.json()
class Reading(Model): """ Weather Reading """ station_id = Field.text() date = Field.datetime() temperature = Field.float() validation = { 'station_id': { 'presence': True }, 'date': { 'presence': True }, 'temperature': { 'presence': True } }
class Extension(Model): name = Field() slug = Field() description = Field() author_name = Field() author_email = Field() github = Field() pypi = Field() version = Field() website = Field() bugtracker = Field() license = Field() status = Field() data = Field.text() updated = Field.datetime() default_values = { 'updated': now } update_values = { 'updated': now }
class XResultRow(Model): tablename = 'XResultRows' belongs_to({'result': 'ScanResult'}) x_index = Field.int() y = Field.text(auto_validation=False)