24 uicfg.rinlined.tag_relation(True, ('CWUser', 'use_email', '*'), 'subject') |
24 uicfg.rinlined.tag_relation(True, ('CWUser', 'use_email', '*'), 'subject') |
25 uicfg.rmode.tag_relation('create', ('*', 'in_group', 'CWGroup'), 'object') |
25 uicfg.rmode.tag_relation('create', ('*', 'in_group', 'CWGroup'), 'object') |
26 uicfg.rmode.tag_relation('link', ('*', 'owned_by', 'CWUser'), 'object') |
26 uicfg.rmode.tag_relation('link', ('*', 'owned_by', 'CWUser'), 'object') |
27 uicfg.rmode.tag_relation('link', ('*', 'created_by', 'CWUser'), 'object') |
27 uicfg.rmode.tag_relation('link', ('*', 'created_by', 'CWUser'), 'object') |
28 uicfg.rmode.tag_relation('create', ('*', 'bookmarked_by', 'CWUser'), 'object') |
28 uicfg.rmode.tag_relation('create', ('*', 'bookmarked_by', 'CWUser'), 'object') |
|
29 uicfg.rdisplay.tag_attribute({}, 'CWUser', 'firstname') |
|
30 uicfg.rdisplay.tag_attribute({}, 'CWUser', 'surname') |
29 |
31 |
30 |
32 |
31 class UserPreferencesEntityAction(action.Action): |
33 class UserPreferencesEntityAction(action.Action): |
32 id = 'prefs' |
34 id = 'prefs' |
33 __select__ = (one_line_rset() & implements('CWUser') & |
35 __select__ = (one_line_rset() & implements('CWUser') & |
42 |
44 |
43 |
45 |
44 class CWUserPrimaryView(PrimaryView): |
46 class CWUserPrimaryView(PrimaryView): |
45 __select__ = implements('CWUser') |
47 __select__ = implements('CWUser') |
46 |
48 |
47 skip_attrs = ('firstname', 'surname') |
|
48 |
|
49 def iter_relations(self, entity): |
|
50 # don't want to display user's entities |
|
51 for rschema, targetschemas, x in super(CWUserPrimaryView, self).iter_relations(entity): |
|
52 if x == 'object' and rschema.type in ('owned_by', 'for_user'): |
|
53 continue |
|
54 yield rschema, targetschemas, x |
|
55 |
|
56 def content_title(self, entity): |
49 def content_title(self, entity): |
57 return entity.name() |
50 return entity.name() |
58 |
|
59 def is_side_related(self, rschema, eschema): |
|
60 # XXX only bookmarked_by defined in cw... |
|
61 return rschema.type in ['interested_in', 'tags', |
|
62 'todo_by', 'bookmarked_by'] |
|
63 |
51 |
64 |
52 |
65 class FoafView(EntityView): |
53 class FoafView(EntityView): |
66 id = 'foaf' |
54 id = 'foaf' |
67 __select__ = implements('CWUser') |
55 __select__ = implements('CWUser') |