schema.py 695 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
from yams.buildobjs import EntityType, String, SubjectRelation


class CWDataSet(EntityType):
    name = String(required=True)
    description = String()
    ckan_dataset_id = String(
        __permissions__={'read': ('managers', 'users', 'guests'),
                         'add': (),
                         'update': ()},
        )
    maintainer = SubjectRelation('CWUser', cardinality='?*')
13
    resources = SubjectRelation('File', cardinality='*?', composite='subject')
14
15
16
17
18
19
20
21


class ckan_resource_id(RelationDefinition):
    __permissions__={'read': ('managers', 'users', 'guests'),
                     'add': (),
                     'update': ()}
    subject = 'File'
    object  = 'String'