1 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
1 # copyright 2003-2017 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
3 # |
3 # |
4 # This file is part of CubicWeb. |
4 # This file is part of CubicWeb. |
5 # |
5 # |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
18 """cw.server.migraction test""" |
18 """cw.server.migraction test""" |
19 import datetime as dt |
19 import datetime as dt |
20 from yams.buildobjs import (EntityType, RelationType, RelationDefinition, |
20 from yams.buildobjs import (EntityType, RelationType, RelationDefinition, |
21 SubjectRelation, Bytes, |
21 SubjectRelation, Bytes, |
22 RichString, String, Int, Boolean, Datetime, Date, Float) |
22 RichString, String, Int, Boolean, Datetime, Date, Float) |
23 from yams.constraints import SizeConstraint, UniqueConstraint |
23 from yams.constraints import SizeConstraint, UniqueConstraint, BoundaryConstraint, Attribute |
24 from cubicweb import _ |
24 from cubicweb import _ |
25 from cubicweb.schema import (WorkflowableEntityType, RQLConstraint, |
25 from cubicweb.schema import (WorkflowableEntityType, RQLConstraint, |
26 RQLVocabularyConstraint, |
26 RQLVocabularyConstraint, |
27 ERQLExpression, RRQLExpression) |
27 ERQLExpression, RRQLExpression) |
28 |
28 |
214 |
214 |
215 class inlined_rel(RelationDefinition): |
215 class inlined_rel(RelationDefinition): |
216 subject = object = 'Folder2' |
216 subject = object = 'Folder2' |
217 inlined = True |
217 inlined = True |
218 cardinality = '??' |
218 cardinality = '??' |
|
219 |
|
220 |
|
221 class Activity(EntityType): |
|
222 start = Datetime(constraints=[BoundaryConstraint('<=', Attribute('end'))], |
|
223 description=_('when the activity started')) |
|
224 end = Datetime(constraints=[BoundaryConstraint('>=', Attribute('start'))], |
|
225 description=_('when the activity ended')) |