<s> try : <EOL> from collections import OrderedDict <EOL> except : <EOL> from gluon . contrib . simplejson . ordered_dict import OrderedDict <EOL> from gluon import current <EOL> from gluon . storage import Storage <EOL> def config ( settings ) : <EOL> """<STR_LIT>""" <EOL> T = current . T <EOL> settings . base . prepopulate += ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> settings . mail . approver = "<STR_LIT>" <EOL> settings . gis . countries = ( "<STR_LIT>" , ) <EOL> settings . gis . legend = "<STR_LIT:float>" <EOL> settings . L10n . utc_offset = "<STR_LIT>" <EOL> settings . L10n . decimal_separator = "<STR_LIT:.>" <EOL> settings . L10n . thousands_separator = "<STR_LIT:U+002C>" <EOL> settings . fin . currencies = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> } <EOL> settings . fin . currency_default = "<STR_LIT>" <EOL> settings . security . policy = <NUM_LIT:8> <EOL> settings . org . sector = True <EOL> settings . ui . cluster = True <EOL> settings . org . resources_tab = True <EOL> settings . org . groups = "<STR_LIT>" <EOL> settings . project . mode_3w = True <EOL> settings . project . mode_drr = True <EOL> settings . project . activities = True <EOL> settings . project . activity_types = True <EOL> settings . project . codes = True <EOL> settings . project . demographics = True <EOL> settings . project . hazards = True <EOL> settings . project . programmes = True <EOL> settings . project . projects = True <EOL> settings . project . themes = True <EOL> settings . project . multiple_organisations = True <EOL> settings . req . req_type = ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> def customise_project_activity_resource ( r , tablename ) : <EOL> s3db = current . s3db <EOL> if r . tablename == "<STR_LIT>" : <EOL> from s3 import S3SQLCustomForm , S3SQLInlineComponent , S3SQLInlineLink <EOL> table = s3db . project_sector_project <EOL> query = ( table . project_id == r . id ) & ( table . deleted == False ) <EOL> rows = current . db ( query ) . select ( table . sector_id ) <EOL> sector_ids = [ row . sector_id for row in rows ] <EOL> crud_form = S3SQLCustomForm ( "<STR_LIT:name>" , <EOL> "<STR_LIT>" , <EOL> S3SQLInlineLink ( "<STR_LIT>" , <EOL> field = "<STR_LIT>" , <EOL> label = T ( "<STR_LIT>" ) , <EOL> filterby = "<STR_LIT:id>" , <EOL> options = sector_ids , <EOL> widget = "<STR_LIT>" , <EOL> ) , <EOL> S3SQLInlineLink ( "<STR_LIT>" , <EOL> field = "<STR_LIT>" , <EOL> label = T ( "<STR_LIT>" ) , <EOL> widget = "<STR_LIT>" , <EOL> ) , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT:date>" , <EOL> "<STR_LIT>" , <EOL> S3SQLInlineComponent ( "<STR_LIT>" , <EOL> fields = [ "<STR_LIT>" , <EOL> "<STR_LIT:value>" , <EOL> ( T ( "<STR_LIT>" ) , "<STR_LIT>" ) , <EOL> ] , <EOL> label = T ( "<STR_LIT>" ) , <EOL> ) , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ) <EOL> s3db . configure ( tablename , <EOL> crud_form = crud_form , <EOL> ) <EOL> list_fields = s3db . get_config ( tablename , "<STR_LIT>" ) <EOL> list_fields . insert ( <NUM_LIT:3> , ( T ( "<STR_LIT>" ) , "<STR_LIT>" ) ) <EOL> elif r . tablename == "<STR_LIT>" : <EOL> list_fields = [ ( "<STR_LIT>" , "<STR_LIT>" ) , <EOL> ( T ( "<STR_LIT>" ) , "<STR_LIT:name>" ) , <EOL> ( T ( "<STR_LIT>" ) , "<STR_LIT>" ) , <EOL> ( T ( "<STR_LIT>" ) , "<STR_LIT>" ) , <EOL> ] <EOL> s3db . configure ( tablename , <EOL> deletable = False , <EOL> editable = False , <EOL> insertable = False , <EOL> list_fields = list_fields , <EOL> ) <EOL> settings . customise_project_activity_resource = customise_project_activity_resource <EOL> settings . modules = OrderedDict ( [ <EOL> ( "<STR_LIT:default>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = False , <EOL> access = None , <EOL> module_type = None <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> access = "<STR_LIT>" , <EOL> module_type = None <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = None <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = False , <EOL> module_type = None <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = <NUM_LIT:6> , <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> access = "<STR_LIT>" , <EOL> module_type = <NUM_LIT:10> <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = <NUM_LIT:1> <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = <NUM_LIT:2> , <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = <NUM_LIT:2> , <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = <NUM_LIT:10> , <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = <NUM_LIT:10> , <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = None , <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = <NUM_LIT:4> <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = <NUM_LIT:10> , <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = <NUM_LIT:2> <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = <NUM_LIT:10> , <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = None , <EOL> ) ) , <EOL> ( "<STR_LIT>" , Storage ( <EOL> name_nice = T ( "<STR_LIT>" ) , <EOL> restricted = True , <EOL> module_type = None , <EOL> ) ) , <EOL> ] ) </s>
