#NEWLINE# @ classmethod #NEWLINE# def super_entity( cls , tablename , key , types , * fields , **args ) : #NEWLINE# #INDENT# '\n            Define a super-entity table\n\n            @param tablename: the tablename\n            @param key: name of the primary key\n            @param types: a dictionary of instance types\n            @param fields: any shared fields\n            @param args: table arguments (e.g. migrate)\n        ' #NEWLINE# db = current . db #NEWLINE# if ( args . _dbname == 'postgres' ) : #NEWLINE# #INDENT# sequence_name = ( '%s_%s_seq' % ( tablename , key ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# sequence_name = None #NEWLINE# #UNINDENT# table = db . define_table ( tablename , Field ( key , 'id' , readable = False , writable = False ) , Field ( 'deleted' , 'boolean' , readable = False , writable = False , default = False ) , Field ( 'instance_type' , represent = ( lambda opt : ( types . get ( opt , opt ) or current . messages [ 'NONE' ] ) ) , readable = False , writable = False ) , Field ( 'uuid' , length = 128 , readable = False , writable = False ) , * fields , sequence_name = sequence_name , ** args ) #NEWLINE# return table