author | Nicolas Chauvat <nicolas.chauvat@logilab.fr> |
Mon, 25 May 2009 00:34:49 +0200 | |
branch | stable |
changeset 1919 | 983dfd00df21 |
parent 1802 | d628defebc17 |
child 1977 | 606923dff11b |
permissions | -rw-r--r-- |
0 | 1 |
from cubicweb.schema import format_constraint |
2 |
||
3 |
class Folder2(MetaUserEntityType): |
|
4 |
"""folders are used to classify entities. They may be defined as a tree. |
|
5 |
When you include the Folder entity, all application specific entities |
|
6 |
may then be classified using the "filed_under" relation. |
|
7 |
""" |
|
8 |
name = String(required=True, indexed=True, internationalizable=True, |
|
9 |
constraints=[UniqueConstraint(), SizeConstraint(64)]) |
|
10 |
description_format = String(meta=True, internationalizable=True, |
|
11 |
default='text/rest', constraints=[format_constraint]) |
|
12 |
description = String(fulltextindexed=True) |
|
13 |
||
14 |
filed_under2 = BothWayRelation( |
|
15 |
SubjectRelation('Folder2', description=_("parent folder")), |
|
16 |
ObjectRelation('*'), |
|
17 |
) |
|
18 |
||
19 |
||
20 |
class filed_under2(MetaUserRelationType): |
|
21 |
"""indicates that an entity is classified under a folder""" |
|
22 |
# is_about has been renamed into filed_under |
|
23 |
#//* is_about Folder |
|
24 |
#* filed_under Folder |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
25 |