equal
deleted
inserted
replaced
1 """ |
|
2 |
|
3 :organization: Logilab |
|
4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
|
5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
|
6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
|
7 """ |
|
8 |
|
9 from yams.buildobjs import (EntityType, RelationDefinition, RelationType, String, |
|
10 Int, SubjectRelation) |
|
11 from yams.constraints import IntervalBoundConstraint |
|
12 |
|
13 class Salesterm(EntityType): |
|
14 described_by_test = SubjectRelation('File', cardinality='1*', composite='subject') |
|
15 amount = Int(constraints=[IntervalBoundConstraint(0, 100)]) |
|
16 reason = String(maxsize=20, vocabulary=[u'canceled', u'sold']) |
|
17 |
|
18 class tags(RelationDefinition): |
|
19 subject = 'Tag' |
|
20 object = ('BlogEntry', 'CWUser') |
|
21 |
|
22 class checked_by(RelationType): |
|
23 subject = 'BlogEntry' |
|
24 object = 'CWUser' |
|
25 cardinality = '?*' |
|
26 permissions = { |
|
27 'add': ('managers',), |
|
28 'read': ('managers', 'users'), |
|
29 'delete': ('managers',), |
|
30 } |
|