author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Thu, 23 Jul 2009 12:08:39 +0200 | |
changeset 2430 | 7d9ed6c740ec |
parent 1977 | 606923dff11b |
child 2459 | d088d0ff48a1 |
permissions | -rw-r--r-- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
1 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
2 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
3 |
:organization: Logilab |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
7 |
""" |
0 | 8 |
from cubicweb.schema import format_constraint |
9 |
||
10 |
class Folder2(MetaUserEntityType): |
|
11 |
"""folders are used to classify entities. They may be defined as a tree. |
|
12 |
When you include the Folder entity, all application specific entities |
|
13 |
may then be classified using the "filed_under" relation. |
|
14 |
""" |
|
15 |
name = String(required=True, indexed=True, internationalizable=True, |
|
16 |
constraints=[UniqueConstraint(), SizeConstraint(64)]) |
|
17 |
description_format = String(meta=True, internationalizable=True, |
|
18 |
default='text/rest', constraints=[format_constraint]) |
|
19 |
description = String(fulltextindexed=True) |
|
20 |
||
21 |
filed_under2 = BothWayRelation( |
|
22 |
SubjectRelation('Folder2', description=_("parent folder")), |
|
23 |
ObjectRelation('*'), |
|
24 |
) |
|
25 |
||
26 |
||
27 |
class filed_under2(MetaUserRelationType): |
|
28 |
"""indicates that an entity is classified under a folder""" |
|
29 |
# is_about has been renamed into filed_under |
|
30 |
#//* is_about Folder |
|
31 |
#* filed_under Folder |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
32 |