<s> """<STR_LIT>""" <EOL> __all__ = ( "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ) <EOL> from gluon import * <EOL> from . . s3 import * <EOL> from s3layouts import S3PopupLink <EOL> class DataCollectionTemplateModel ( S3Model ) : <EOL> names = ( "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ) <EOL> def model ( self ) : <EOL> T = current . T <EOL> db = current . db <EOL> crud_strings = current . response . s3 . crud_strings <EOL> define_table = self . define_table <EOL> add_components = self . add_components <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> Field ( "<STR_LIT:name>" , <EOL> requires = IS_NOT_EMPTY ( ) , <EOL> ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> default = False , <EOL> ) , <EOL> s3_comments ( ) , <EOL> * s3_meta_fields ( ) ) <EOL> self . configure ( tablename , <EOL> xform = { "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> } , <EOL> ) <EOL> represent = S3Represent ( lookup = tablename ) <EOL> template_id = S3ReusableField ( "<STR_LIT>" , "<STR_LIT>" % tablename , <EOL> label = T ( "<STR_LIT>" ) , <EOL> represent = represent , <EOL> requires = IS_ONE_OF ( db , "<STR_LIT>" , <EOL> represent , <EOL> ) , <EOL> sortby = "<STR_LIT:name>" , <EOL> comment = S3PopupLink ( f = "<STR_LIT>" , <EOL> tooltip = T ( "<STR_LIT>" ) , <EOL> ) , <EOL> ) <EOL> crud_strings [ tablename ] = Storage ( <EOL> label_create = T ( "<STR_LIT>" ) , <EOL> title_display = T ( "<STR_LIT>" ) , <EOL> title_list = T ( "<STR_LIT>" ) , <EOL> title_update = T ( "<STR_LIT>" ) , <EOL> title_upload = T ( "<STR_LIT>" ) , <EOL> label_list_button = T ( "<STR_LIT>" ) , <EOL> label_delete_button = T ( "<STR_LIT>" ) , <EOL> msg_record_created = T ( "<STR_LIT>" ) , <EOL> msg_record_modified = T ( "<STR_LIT>" ) , <EOL> msg_record_deleted = T ( "<STR_LIT>" ) , <EOL> msg_list_empty = T ( "<STR_LIT>" ) ) <EOL> add_components ( tablename , <EOL> dc_question = { "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:key>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : False , <EOL> } , <EOL> ) <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> Field ( "<STR_LIT>" , <EOL> requires = IS_NOT_EMPTY ( ) , <EOL> ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> requires = IS_EMPTY_OR ( IS_JSON ( native_json = True ) ) , <EOL> widget = S3QuestionWidget ( ) , <EOL> ) , <EOL> * s3_meta_fields ( ) ) <EOL> crud_strings [ tablename ] = Storage ( <EOL> label_create = T ( "<STR_LIT>" ) , <EOL> title_display = T ( "<STR_LIT>" ) , <EOL> title_list = T ( "<STR_LIT>" ) , <EOL> title_update = T ( "<STR_LIT>" ) , <EOL> title_upload = T ( "<STR_LIT>" ) , <EOL> label_list_button = T ( "<STR_LIT>" ) , <EOL> label_delete_button = T ( "<STR_LIT>" ) , <EOL> msg_record_created = T ( "<STR_LIT>" ) , <EOL> msg_record_modified = T ( "<STR_LIT>" ) , <EOL> msg_record_deleted = T ( "<STR_LIT>" ) , <EOL> msg_list_empty = T ( "<STR_LIT>" ) ) <EOL> represent = S3Represent ( lookup = tablename , <EOL> fields = [ "<STR_LIT>" ] , <EOL> show_link = True , <EOL> ) <EOL> question_id = S3ReusableField ( "<STR_LIT>" , "<STR_LIT>" % tablename , <EOL> label = T ( "<STR_LIT>" ) , <EOL> represent = represent , <EOL> requires = IS_ONE_OF ( db , "<STR_LIT>" , <EOL> represent , <EOL> ) , <EOL> sortby = "<STR_LIT:name>" , <EOL> comment = S3PopupLink ( f = "<STR_LIT>" , <EOL> tooltip = T ( "<STR_LIT>" ) , <EOL> ) , <EOL> ) <EOL> add_components ( tablename , <EOL> dc_question_l10n = "<STR_LIT>" , <EOL> ) <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> template_id ( ) , <EOL> question_id ( ) , <EOL> * s3_meta_fields ( ) ) <EOL> crud_strings [ tablename ] = Storage ( <EOL> label_create = T ( "<STR_LIT>" ) , <EOL> label_delete_button = T ( "<STR_LIT>" ) , <EOL> msg_record_created = T ( "<STR_LIT>" ) , <EOL> msg_record_deleted = T ( "<STR_LIT>" ) , <EOL> msg_list_empty = T ( "<STR_LIT>" ) ) <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> question_id ( ondelete = "<STR_LIT>" , <EOL> ) , <EOL> Field ( "<STR_LIT>" , <EOL> label = T ( "<STR_LIT>" ) , <EOL> represent = IS_ISO639_2_LANGUAGE_CODE . represent , <EOL> requires = IS_ISO639_2_LANGUAGE_CODE ( sort = True ) , <EOL> ) , <EOL> Field ( "<STR_LIT>" , <EOL> requires = IS_NOT_EMPTY ( ) , <EOL> ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> requires = IS_EMPTY_OR ( IS_JSON ( ) ) , <EOL> ) , <EOL> s3_comments ( ) , <EOL> * s3_meta_fields ( ) ) <EOL> crud_strings [ tablename ] = Storage ( <EOL> label_create = T ( "<STR_LIT>" ) , <EOL> title_display = T ( "<STR_LIT>" ) , <EOL> title_list = T ( "<STR_LIT>" ) , <EOL> title_update = T ( "<STR_LIT>" ) , <EOL> title_upload = T ( "<STR_LIT>" ) , <EOL> label_list_button = T ( "<STR_LIT>" ) , <EOL> label_delete_button = T ( "<STR_LIT>" ) , <EOL> msg_record_created = T ( "<STR_LIT>" ) , <EOL> msg_record_modified = T ( "<STR_LIT>" ) , <EOL> msg_record_deleted = T ( "<STR_LIT>" ) , <EOL> msg_list_empty = T ( "<STR_LIT>" ) ) <EOL> return dict ( dc_template_id = template_id , <EOL> dc_question_id = question_id , <EOL> ) <EOL> @ staticmethod <EOL> def defaults ( ) : <EOL> """<STR_LIT>""" <EOL> dummy = S3ReusableField ( "<STR_LIT>" , "<STR_LIT>" , <EOL> readable = False , <EOL> writable = False , <EOL> ) <EOL> return dict ( dc_template_id = lambda ** attr : dummy ( "<STR_LIT>" ) , <EOL> dc_question_id = lambda ** attr : dummy ( "<STR_LIT>" ) , <EOL> ) <EOL> class DataCollectionModel ( S3Model ) : <EOL> names = ( "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ) <EOL> def model ( self ) : <EOL> T = current . T <EOL> db = current . db <EOL> crud_strings = current . response . s3 . crud_strings <EOL> define_table = self . define_table <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> self . super_link ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> self . dc_template_id ( ) , <EOL> s3_date ( default = "<STR_LIT>" ) , <EOL> self . gis_location_id ( ) , <EOL> self . org_organisation_id ( ) , <EOL> self . pr_person_id ( <EOL> default = current . auth . s3_logged_in_person ( ) , <EOL> ) , <EOL> s3_comments ( ) , <EOL> * s3_meta_fields ( ) ) <EOL> self . configure ( tablename , <EOL> super_entity = "<STR_LIT>" , <EOL> orderby = "<STR_LIT>" , <EOL> ) <EOL> self . add_components ( tablename , <EOL> dc_answer = "<STR_LIT>" , <EOL> ) <EOL> crud_strings [ tablename ] = Storage ( <EOL> label_create = T ( "<STR_LIT>" ) , <EOL> title_display = T ( "<STR_LIT>" ) , <EOL> title_list = T ( "<STR_LIT>" ) , <EOL> title_update = T ( "<STR_LIT>" ) , <EOL> title_upload = T ( "<STR_LIT>" ) , <EOL> label_list_button = T ( "<STR_LIT>" ) , <EOL> label_delete_button = T ( "<STR_LIT>" ) , <EOL> msg_record_created = T ( "<STR_LIT>" ) , <EOL> msg_record_modified = T ( "<STR_LIT>" ) , <EOL> msg_record_deleted = T ( "<STR_LIT>" ) , <EOL> msg_list_empty = T ( "<STR_LIT>" ) ) <EOL> represent = S3Represent ( lookup = tablename , <EOL> fields = [ "<STR_LIT:date>" ] , <EOL> ) <EOL> collection_id = S3ReusableField ( "<STR_LIT>" , "<STR_LIT>" % tablename , <EOL> label = T ( "<STR_LIT>" ) , <EOL> represent = represent , <EOL> requires = IS_ONE_OF ( db , "<STR_LIT>" , <EOL> represent , <EOL> ) , <EOL> comment = S3PopupLink ( f = "<STR_LIT>" , <EOL> tooltip = T ( "<STR_LIT>" ) , <EOL> ) , <EOL> ) <EOL> tablename = "<STR_LIT>" <EOL> define_table ( tablename , <EOL> collection_id ( ) , <EOL> self . dc_question_id ( ) , <EOL> Field ( "<STR_LIT>" , "<STR_LIT>" , <EOL> requires = IS_EMPTY_OR ( IS_JSON ( ) ) , <EOL> ) , <EOL> s3_comments ( ) , <EOL> * s3_meta_fields ( ) ) <EOL> crud_strings [ tablename ] = Storage ( <EOL> label_create = T ( "<STR_LIT>" ) , <EOL> title_display = T ( "<STR_LIT>" ) , <EOL> title_list = T ( "<STR_LIT>" ) , <EOL> title_update = T ( "<STR_LIT>" ) , <EOL> title_upload = T ( "<STR_LIT>" ) , <EOL> label_list_button = T ( "<STR_LIT>" ) , <EOL> label_delete_button = T ( "<STR_LIT>" ) , <EOL> msg_record_created = T ( "<STR_LIT>" ) , <EOL> msg_record_modified = T ( "<STR_LIT>" ) , <EOL> msg_record_deleted = T ( "<STR_LIT>" ) , <EOL> msg_list_empty = T ( "<STR_LIT>" ) ) <EOL> return dict ( dc_collection_id = collection_id , <EOL> ) <EOL> @ staticmethod <EOL> def defaults ( ) : <EOL> """<STR_LIT>""" <EOL> dummy = S3ReusableField ( "<STR_LIT>" , "<STR_LIT>" , <EOL> readable = False , <EOL> writable = False , <EOL> ) <EOL> return dict ( dc_collection_id = lambda ** attr : dummy ( "<STR_LIT>" ) , <EOL> ) <EOL> def dc_rheader ( r , tabs = None ) : <EOL> """<STR_LIT>""" <EOL> T = current . T <EOL> if r . representation != "<STR_LIT:html>" : <EOL> return None <EOL> resourcename = r . name <EOL> if resourcename == "<STR_LIT>" : <EOL> tabs = ( ( T ( "<STR_LIT>" ) , None ) , <EOL> ( T ( "<STR_LIT>" ) , "<STR_LIT>" ) , <EOL> ) <EOL> rheader_fields = ( [ "<STR_LIT:name>" ] , <EOL> ) <EOL> rheader = S3ResourceHeader ( rheader_fields , tabs ) ( r ) <EOL> elif resourcename == "<STR_LIT>" : <EOL> tabs = ( ( T ( "<STR_LIT>" ) , None ) , <EOL> ( T ( "<STR_LIT>" ) , "<STR_LIT>" ) , <EOL> ) <EOL> rheader_fields = ( [ "<STR_LIT>" ] , <EOL> ) <EOL> rheader = S3ResourceHeader ( rheader_fields , tabs ) ( r ) <EOL> elif resourcename == "<STR_LIT>" : <EOL> tabs = ( ( T ( "<STR_LIT>" ) , None ) , <EOL> ( T ( "<STR_LIT>" ) , "<STR_LIT>" ) , <EOL> ( T ( "<STR_LIT>" ) , "<STR_LIT>" ) , <EOL> ) <EOL> rheader_fields = ( [ "<STR_LIT>" ] , <EOL> [ "<STR_LIT>" ] , <EOL> [ "<STR_LIT:date>" ] , <EOL> ) <EOL> rheader = S3ResourceHeader ( rheader_fields , tabs ) ( r ) <EOL> else : <EOL> rheader = "<STR_LIT>" <EOL> return rheader </s>
