Ejemplo n.º 1
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
Ejemplo n.º 2
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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo n.º 16
0
    def form_to_db_schema(self):
		schema = ckan_schema.group_form_schema()

		return schema
Ejemplo 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()
Ejemplo 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()
Ejemplo n.º 19
0
 def form_to_db_schema(self) -> dict[str, Any]:
     return schema.group_form_schema()
Ejemplo n.º 20
0
 def _form_to_db_schema(self):
     return group_form_schema()
Ejemplo n.º 21
0
 def _form_to_db_schema(self):
     return group_form_schema()