def db_to_form_schema(self):
        schema = group_form_schema()

        schema.update({
            'email': [convert_from_extras, ignore_missing]
        })

        schema.update({
            'url': [convert_from_extras, ignore_missing]
        })

        schema.update({
            'bbox': [convert_from_extras, ignore_missing]
        })

        schema.update({
            'policy_url': [convert_from_extras, ignore_missing]
        })


        schema.update({
            'org_type': [convert_from_extras, ignore_missing]
        })


        return schema
    def form_to_db_schema(self):
        schema = group_form_schema()

        schema.update({
            'email': [ignore_missing, convert_to_extras]
        })

        schema.update({
            'url': [ignore_missing, convert_to_extras]
        }
        )

        schema.update({
            'bbox': [ignore_missing, convert_to_extras]
        })

        schema.update({
            'policy_url': [ignore_missing, convert_to_extras]
        })

        schema.update({
            'org_type': [ignore_missing, convert_to_extras]
        })


        return schema
Esempio n. 3
0
    def db_to_form_schema(self):
        schema = group_form_schema()
        schema.update({
            'title_fr': [convert_from_extras, ignore_missing],
            'description_fr': [convert_from_extras, ignore_missing]
        })

        return schema
Esempio n. 4
0
    def db_to_form_schema(self):
        schema = group_form_schema()
        schema.update({
            'title_fr': [convert_from_extras, ignore_missing],
            'description_fr': [convert_from_extras, ignore_missing]
        })

        return schema
Esempio n. 5
0
    def form_to_db_schema(self):
        schema =  group_form_schema()
        schema.update({
            'title_fr': [ignore_missing, unicode, convert_to_extras],
            'description_fr': [ignore_missing, unicode, convert_to_extras]
        })

        return schema
Esempio n. 6
0
    def form_to_db_schema(self):
        schema = group_form_schema()
        schema.update({
            'title_fr': [ignore_missing, unicode, convert_to_extras],
            'description_fr': [ignore_missing, unicode, convert_to_extras]
        })

        return schema
Esempio n. 7
0
 def form_to_db_schema(self, group_type=None):
     schema = group_form_schema()
     schema.update({
         'id': [if_empty_generate_uuid],
         'title': [not_empty, unicode],
         'name': [ignore_missing, unicode, slugify_title_to_name,
                  organization_name_validator],
         'orgURL': [ignore_missing, unicode, convert_to_extras],
         'contact': [ignore_missing, unicode, convert_to_extras],
         '__after': [create_or_update_cadasta_organization],
     })
     return schema
Esempio n. 8
0
    def form_to_db_schema_options(self, options):

        # Get the default organization schema
        schema = super(SchemaPlugin, self).form_to_db_schema_options(options)

        if not schema:
            from ckan.logic.schema import group_form_schema
            schema = group_form_schema()

        # Add custom fields to organization schema
        schema.update({'private': [ignore_missing, unicode, cnvrt_to_ext]})

        return schema
Esempio n. 9
0
 def form_to_db_schema(self, group_type=None):
     from ckan.logic.schema import group_form_schema
     schema = {
         'foi-name': [ignore_missing, unicode, convert_to_extras],
         'foi-email': [ignore_missing, unicode, convert_to_extras],
         'foi-phone': [ignore_missing, unicode, convert_to_extras],
         'contact-name': [ignore_missing, unicode, convert_to_extras],
         'contact-email': [ignore_missing, unicode, convert_to_extras],
         'contact-phone': [ignore_missing, unicode, convert_to_extras],
         'category': [validate_publisher_category, convert_to_extras],
         'abbreviation': [ignore_missing, unicode, convert_to_extras],
     }
     schema.update( group_form_schema() )
     return schema
Esempio n. 10
0
    def form_to_db_schema(self):
        schema = group_form_schema()

        schema.update({'email': [ignore_missing, convert_to_extras]})

        schema.update({'url': [ignore_missing, convert_to_extras]})

        schema.update({'bbox': [ignore_missing, convert_to_extras]})

        schema.update({'policy_url': [ignore_missing, convert_to_extras]})

        schema.update({'org_type': [ignore_missing, convert_to_extras]})

        return schema
Esempio n. 11
0
 def form_to_db_schema(self, group_type=None):
     from ckan.logic.schema import group_form_schema
     schema = {
         'foi-name': [ignore_missing, unicode, convert_to_extras],
         'foi-email': [ignore_missing, unicode, convert_to_extras],
         'foi-phone': [ignore_missing, unicode, convert_to_extras],
         'contact-name': [ignore_missing, unicode, convert_to_extras],
         'contact-email': [ignore_missing, unicode, convert_to_extras],
         'contact-phone': [ignore_missing, unicode, convert_to_extras],
         'category': [validate_publisher_category, convert_to_extras],
         'abbreviation': [ignore_missing, unicode, convert_to_extras],
     }
     schema.update(group_form_schema())
     return schema
Esempio n. 12
0
    def db_to_form_schema(self):
        schema = group_form_schema()

        schema.update({'email': [convert_from_extras, ignore_missing]})

        schema.update({'url': [convert_from_extras, ignore_missing]})

        schema.update({'bbox': [convert_from_extras, ignore_missing]})

        schema.update({'policy_url': [convert_from_extras, ignore_missing]})

        schema.update({'org_type': [convert_from_extras, ignore_missing]})

        return schema
Esempio n. 13
0
 def form_to_db_schema_options(self, options):
     
     #Get the default organization schema
     schema = super(HierarchyForm, self).form_to_db_schema_options(options)
     
     if not schema:
         from ckan.logic.schema import group_form_schema
         schema = group_form_schema()
     
     #Add custom fields to organization schema
     schema.update({
                   'url': [ignore_missing, unicode, cnvrt_to_ext],
                   'sector' : [ignore_missing, unicode, cnvrt_to_ext]
                   })
     
     return schema
Esempio n. 14
0
 def form_to_db_schema(self, group_type=None):
     from ckan.logic.schema import group_form_schema
     schema = {
         'foi-name': [ignore_missing, unicode, convert_to_extras],
         'foi-email': [ignore_missing, unicode, convert_to_extras],
         'foi-phone': [ignore_missing, unicode, convert_to_extras],
         'foi-web': [ignore_missing, unicode, convert_to_extras],
         'contact-name': [ignore_missing, unicode, convert_to_extras],
         'contact-email': [ignore_missing, unicode, convert_to_extras],
         'contact-phone': [ignore_missing, unicode, convert_to_extras],
         'category': [validate_publisher_category, convert_to_extras],
         'abbreviation': [ignore_missing, unicode, convert_to_extras],
         'closed': [dgu_boolean_validator, convert_to_extras],
         'replaced_by': [value_if_missing([]), to_json, convert_to_extras],
     }
     schema.update( group_form_schema() )
     return schema
Esempio n. 15
0
 def form_to_db_schema(self):
     from ckan.logic.schema import group_form_schema
     schema = group_form_schema()
     for mandatory_extra in ['category']:
         schema.update({
             mandatory_extra:
             [toolkit.get_converter('convert_to_extras'), unicode]
         })
     for optional_extra in [
             'contact-name', 'contact-email', 'contact-phone', 'foi-name',
             'foi-email', 'foi-web', 'foi-phone'
     ]:
         schema.update({
             optional_extra: [
                 toolkit.get_validator('ignore_missing'),
                 toolkit.get_converter('convert_to_extras'), unicode
             ]
         })
     return schema
Esempio n. 16
0
    def form_to_db_schema(self):
		schema = ckan_schema.group_form_schema()

		return schema
Esempio n. 17
0
 def db_to_form_schema(self):
     """
     Returns the schema for mapping group data from the database into a
     format suitable for the form (optional)
     """
     return group_form_schema()
Esempio n. 18
0
 def form_to_db_schema(self):
     """
     Returns the schema for mapping group data from a form to a format
     suitable for the database.
     """
     return group_form_schema()
Esempio n. 19
0
 def form_to_db_schema(self) -> dict[str, Any]:
     return schema.group_form_schema()
Esempio n. 20
0
 def _form_to_db_schema(self):
     return group_form_schema()
Esempio n. 21
0
 def _form_to_db_schema(self):
     return group_form_schema()