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


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


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