Esempio n. 1
0
    def _modify_group_schema(self, schema):
        TO_EXTRAS = toolkit.get_converter('convert_to_extras')

        for field in dcatapit_schema.get_custom_organization_schema():
            schema[field['name']] = [toolkit.get_validator(v) for v in field['validator']] + [ TO_EXTRAS ]

        return schema
Esempio n. 2
0
    def db_to_form_schema(self):
        '''This is an interface to manipulate data from the database
        into a format suitable for the form (optional)'''
        schema = logic.schema.default_show_group_schema()
        schema['extras'] = logic.schema.default_extras_schema()

        FROM_EXTRAS = toolkit.get_converter('convert_from_extras')

        for field in dcatapit_schema.get_custom_organization_schema():
            schema[field['name']] = [ FROM_EXTRAS ] + [toolkit.get_validator(v) for v in field['validator']]

        return schema
Esempio n. 3
0
    def _modify_group_schema(self, schema):
        for field in dcatapit_schema.get_custom_organization_schema():

            validators = []
            for validator in field['validator']:
                validators.append(toolkit.get_validator(validator))

            schema.update({
                field['name']:
                validators + [toolkit.get_converter('convert_to_extras')]
            })

        return schema
Esempio n. 4
0
    def db_to_form_schema(self):
        '''This is an interface to manipulate data from the database
        into a format suitable for the form (optional)'''
        schema = self.default_show_group_schema()

        for field in dcatapit_schema.get_custom_organization_schema():

            validators = []
            for validator in field['validator']:
                validators.append(toolkit.get_validator(validator))

            schema.update({
                field['name']:
                [toolkit.get_converter('convert_from_extras')] + validators
            })

        return schema
def get_dcatapit_organization_schema():
    log.debug('Retrieving DCAT-AP_IT organization schema fields...')
    return dcatapit_schema.get_custom_organization_schema()