def _show(self):
        schemas = [
            ("Dataset", scheming_dataset_schemas()),
            ("Group", scheming_group_schemas()),
            ("Organization", scheming_organization_schemas()),
        ]

        for n, s in schemas:
            print n, "schemas:"
            if s is None:
                print "    plugin not loaded or schema not specified\n"
                continue
            if not s:
                print "    no schemas"
            for typ in sorted(s):
                print " * " + json.dumps(typ)
                field_names = ('dataset_fields', 'fields', 'resource_fields')

                for field_name in field_names:
                    if s[typ].get(field_name):
                        if field_name == 'resource_fields':
                            print " * " + json.dumps("resource")
                        for field in s[typ][field_name]:
                            print "   - " + json.dumps(field['field_name'])
            print
Beispiel #2
0
    def _show(self):
        schemas = [
            ("Dataset", scheming_dataset_schemas()),
            ("Group", scheming_group_schemas()),
            ("Organization", scheming_organization_schemas()),
        ]

        for n, s in schemas:
            print n, "schemas:"
            if s is None:
                print "    plugin not loaded or schema not specified\n"
                continue
            if not s:
                print "    no schemas"
            for typ in sorted(s):
                print " * " + json.dumps(typ)
                field_names = ('dataset_fields', 'fields', 'resource_fields')

                for field_name in field_names:
                    if s[typ].get(field_name):
                        if field_name == 'resource_fields':
                            print " * " + json.dumps("resource")
                        for field in s[typ][field_name]:
                            print "   - " + json.dumps(field['field_name']),
                            print scheming_language_text(field.get('label'))
            print
Beispiel #3
0
 def _show(self):
     for n, s in (
             ("Dataset", scheming_dataset_schemas()),
             ("Group", scheming_group_schemas()),
             ("Organization", scheming_organization_schemas()),
             ):
         print n, "schemas:"
         if s is None:
             print "    plugin not loaded\n"
             continue
         if not s:
             print "    no schemas"
         for typ in sorted(s):
             print " * " + json.dumps(typ)
             for field in s[typ]['fields']:
                 print "   - " + json.dumps(field['field_name'])
         print
Beispiel #4
0
 def _show(self):
     for n, s in (
         ("Dataset", scheming_dataset_schemas()),
         ("Group", scheming_group_schemas()),
         ("Organization", scheming_organization_schemas()),
     ):
         print n, "schemas:"
         if s is None:
             print "    plugin not loaded\n"
             continue
         if not s:
             print "    no schemas"
         for typ in sorted(s):
             print " * " + json.dumps(typ)
             for field in s[typ]['fields']:
                 print "   - " + json.dumps(field['field_name'])
         print
Beispiel #5
0
def scheming_organization_schema_list(context, data_dict):
    """
    Return a list of organization types customized with the scheming extension
    """
    return list(scheming_organization_schemas())
Beispiel #6
0
def scheming_organization_schema_list(context, data_dict):
    '''
    Return a list of organization types customized with the scheming extension
    '''
    return list(scheming_organization_schemas())