15 # |
15 # |
16 # You should have received a copy of the GNU Lesser General Public License along |
16 # You should have received a copy of the GNU Lesser General Public License along |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 |
18 |
19 from yams.buildobjs import (EntityType, RelationType, RelationDefinition, |
19 from yams.buildobjs import (EntityType, RelationType, RelationDefinition, |
20 SubjectRelation, RichString, String, Int, Boolean, Datetime) |
20 SubjectRelation, RichString, String, Int, Float, |
|
21 Boolean, Datetime) |
21 from yams.constraints import SizeConstraint |
22 from yams.constraints import SizeConstraint |
22 from cubicweb.schema import (WorkflowableEntityType, RQLConstraint, |
23 from cubicweb.schema import (WorkflowableEntityType, RQLConstraint, |
23 ERQLExpression, RRQLExpression) |
24 ERQLExpression, RRQLExpression) |
24 |
25 |
25 class Affaire(WorkflowableEntityType): |
26 class Affaire(WorkflowableEntityType): |
37 constraints=[SizeConstraint(256)]) |
38 constraints=[SizeConstraint(256)]) |
38 descr = RichString(fulltextindexed=True, |
39 descr = RichString(fulltextindexed=True, |
39 description=_('more detailed description')) |
40 description=_('more detailed description')) |
40 |
41 |
41 duration = Int() |
42 duration = Int() |
42 invoiced = Int() |
43 invoiced = Float() |
43 |
44 |
44 depends_on = SubjectRelation('Affaire') |
45 depends_on = SubjectRelation('Affaire') |
45 require_permission = SubjectRelation('CWPermission') |
46 require_permission = SubjectRelation('CWPermission') |
46 concerne = SubjectRelation(('Societe', 'Note')) |
47 concerne = SubjectRelation(('Societe', 'Note')) |
47 todo_by = SubjectRelation('Personne', cardinality='?*') |
48 todo_by = SubjectRelation('Personne', cardinality='?*') |