| |True|# coding: utf8
signature = db.Table(db,'auth_signature',
Field('created_on','datetime',default=request.now,
writable=False,readable=False, label=T('Created on')),
Field('created_by','reference %s' % auth.settings.table_user_name,default=auth.user_id,
writable=False,readable=False, label=T('Created by')),
Field('modified_on','datetime',update=request.now,default=request.now,
writable=False,readable=False, label=T('Modified on')),
Field('modified_by','reference %s' % auth.settings.table_user_name,
default=auth.user_id,update=auth.user_id,
writable=False,readable=False, label=T('Modified by'))
)
db._common_fields.append(signature) #db._common_fields is a list of fields that should belong to all the tables
db.define_table('category',
Field('is_enabled', 'boolean', default=True, label=T('Enabled')),
Field('name', 'string', length=256, label=T('Name')),
Field('description', 'text', readable=True, writable=True, label=T('Description')),
format='%(name)s'
)| |