1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
1 # copyright 2003-2016 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 |
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
14 # details. |
14 # details. |
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 """schema for cubicweb.devtools tests""" |
|
19 from yams.buildobjs import EntityType, SubjectRelation, String, RichString, Int, Date |
19 |
20 |
20 """ |
|
21 from yams.buildobjs import EntityType, SubjectRelation, String, Int, Date |
|
22 |
21 |
23 from cubes.person.schema import Person |
22 class Person(EntityType): |
|
23 """a physical person""" |
|
24 surname = String(required=True, fulltextindexed=True, indexed=True, |
|
25 maxsize=64) |
|
26 firstname = String(fulltextindexed=True, maxsize=64) |
|
27 civility = String(required=True, internationalizable=True, |
|
28 vocabulary=('Mr', 'Ms', 'Mrs'), |
|
29 default='Mr') |
|
30 description = RichString(fulltextindexed=True) |
|
31 birthday = Date() |
24 |
32 |
25 Person.add_relation(Date(), 'birthday') |
|
26 |
33 |
27 class Bug(EntityType): |
34 class Bug(EntityType): |
28 title = String(maxsize=64, required=True, fulltextindexed=True) |
35 title = String(maxsize=64, required=True, fulltextindexed=True) |
29 severity = String(vocabulary=('important', 'normal', 'minor'), default='normal') |
36 severity = String(vocabulary=('important', 'normal', 'minor'), |
|
37 default='normal') |
30 cost = Int() |
38 cost = Int() |
31 description = String(maxsize=4096, fulltextindexed=True) |
39 description = String(maxsize=4096, fulltextindexed=True) |
32 identical_to = SubjectRelation('Bug', symmetric=True) |
40 identical_to = SubjectRelation('Bug', symmetric=True) |