web/test/data/schema/testschema.py
author Florent <florent@secondweb.fr>
Mon, 18 May 2009 11:50:43 +0200
branchstable
changeset 1836 d3f0c6e868ef
parent 1802 d628defebc17
child 1977 606923dff11b
permissions -rw-r--r--
fix StringField widget selection with SizeConstraint and StaticVocabularyConstraint constraints

class Salesterm(EntityType):
    described_by_test = SubjectRelation('File', cardinality='1*', composite='subject')
    amount = Int(constraints=[IntervalBoundConstraint(0, 100)])
    reason = String(maxsize=20, vocabulary=[u'canceled', u'sold'])

class tags(RelationDefinition):
    subject = 'Tag'
    object = ('BlogEntry', 'CWUser')

class checked_by(RelationType):
    subject = 'BlogEntry'
    object = 'CWUser'
    cardinality = '?*'
    permissions = {
        'add': ('managers',),
        'read': ('managers', 'users'),
        'delete': ('managers',),
        }