web/views/euser.py
author Laure Bourgois <Laure.Bourgois@logilab.fr>
Fri, 06 Feb 2009 11:05:41 +0100
changeset 557 8bb60606e5ad
parent 556 64d26324d3eb
child 558 a8887dd924f4
permissions -rw-r--r--
small fix
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     1
"""Specific views for users
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     2
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     3
:organization: Logilab
523
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
     4
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     5
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     6
"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     7
__docformat__ = "restructuredtext en"
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     8
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
     9
from logilab.common.decorators import cached
523
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    10
from logilab.mtconverter import html_escape
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    11
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    12
from cubicweb.schema import display_name
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    13
from cubicweb.web import INTERNAL_FIELD_VALUE
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    14
from cubicweb.web.form import EntityForm
523
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    15
from cubicweb.web.views.baseviews import PrimaryView, EntityView
557
8bb60606e5ad small fix
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 556
diff changeset
    16
8bb60606e5ad small fix
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 556
diff changeset
    17
import hashlib
8bb60606e5ad small fix
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 556
diff changeset
    18
555
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    19
try:
557
8bb60606e5ad small fix
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 556
diff changeset
    20
    from hashlib import sha1
8bb60606e5ad small fix
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 556
diff changeset
    21
    
8bb60606e5ad small fix
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 556
diff changeset
    22
except ImportError:
8bb60606e5ad small fix
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 556
diff changeset
    23
    from sha import sha as sha1
555
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    24
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    25
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    26
class EUserPrimaryView(PrimaryView):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    27
    accepts = ('EUser',)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    28
    skip_attrs = ('firstname', 'surname')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    29
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    30
    def iter_relations(self, entity):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    31
        # don't want to display user's entities
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    32
        for rschema, targetschemas, x in super(EUserPrimaryView, self).iter_relations(entity):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    33
            if x == 'object' and rschema.type in ('owned_by', 'for_user'):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    34
                continue
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    35
            yield rschema, targetschemas, x
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    36
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    37
    def content_title(self, entity):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    38
        return entity.name()
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    39
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    40
    def is_side_related(self, rschema, eschema):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    41
        return  rschema.type in ['interested_in', 'tags', 
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    42
                                 'todo_by', 'bookmarked_by',
556
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 555
diff changeset
    43
                                 ]
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 555
diff changeset
    44
523
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    45
class FoafView(EntityView):
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    46
    id = 'foaf'
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    47
    accepts = ('EUser',)
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    48
    title = _('foaf')
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    49
    templatable = False
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    50
    content_type = 'text/xml'
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    51
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    52
    def call(self):
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    53
        self.w(u'<?xml version="1.0" encoding="%s"?>\n' % self.req.encoding)
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    54
        self.w(u'<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n')
555
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    55
        self.w(u'xmlns:rdfs="http://www.w3org/2000/01/rdf-schema#"\n')
523
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    56
        self.w(u'xmlns:foaf="http://xmlns.com/foaf/0.1/">\n')
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    57
        for i in xrange(self.rset.rowcount):
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    58
            self.cell_call(i, 0)
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    59
        self.w(u'</rdf:RDF>\n')
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    60
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    61
    def cell_call(self, row, col):
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    62
        entity = self.complete_entity(row, col)
555
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    63
        self.w(u'''<foaf:PersonalProfileDocument rdf:about="">
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    64
                      <foaf:maker rdf:resource="%s"/>
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    65
                      <foaf:primaryTopic rdf:resource="%s"/>
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    66
                   </foaf:PersonalProfileDocument>''' % (entity.absolute_url(), entity.absolute_url()))
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    67
                      
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    68
        self.w(u'<foaf:Person rdf:ID="%s">\n' % entity.eid)
523
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    69
        self.w(u'<foaf:name>%s</foaf:name>\n' % html_escape(entity.dc_long_title()))
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    70
        if entity.surname:
555
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    71
            self.w(u'<foaf:family_name>%s</foaf:family_name>\n'
523
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    72
                   % html_escape(entity.surname))
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    73
        if entity.firstname:
555
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    74
            self.w(u'<foaf:givenname>%s</foaf:givenname>\n'
523
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    75
                   % html_escape(entity.firstname))
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    76
        emailaddr = entity.get_email()
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    77
        if emailaddr:
555
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    78
            m = hashlib.sha1()
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    79
            m.update(html_escape(emailaddr))
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    80
            crypt_sha1 = m.hexdigest()
b40d885ba7a4 new foaf version
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 523
diff changeset
    81
            self.w(u'<foaf:mbox_sha1sum>%s</foaf:mbox_sha1sum>\n' % crypt_sha1)
556
Laure Bourgois <Laure.Bourgois@logilab.fr>
parents: 555
diff changeset
    82
            self.w(u'</foaf:Person>\n')
523
f01cfce2e8d2 foaf euser view
sylvain.thenault@logilab.fr
parents: 0
diff changeset
    83
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    84
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    85
class EditGroups(EntityForm):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    86
    """displays a simple euser / egroups editable table"""
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    87
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    88
    id = 'editgroups'
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    89
    accepts = ('EUser',)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    90
    
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    91
    def call(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    92
        self.req.add_css('cubicweb.acl.css')            
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    93
        _ = self.req._
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    94
        self.w(u'<form id="editgroup" method="post" action="edit">')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    95
        self.w(u'<table id="groupedit">\n')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    96
        self.w(u'<tr>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    97
        self.w(u'<th>%s</th>' % display_name(self.req, 'EUser'))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    98
        self.w(u''.join(u'<th>%s</th>' % _(gname) for geid, gname in self.egroups))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    99
        self.w(u'</tr>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   100
        for row in xrange(len(self.rset)):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   101
            self.build_table_line(row)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   102
        self.w(u'</table>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   103
        self.w(u'<fieldset>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   104
        self.w(self.button_cancel())
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   105
        self.w(self.button_ok())
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   106
        self.w(u'</fieldset>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   107
        self.w(u'</form>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   108
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   109
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   110
    def build_table_line(self, row):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   111
        euser = self.entity(row)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   112
        euser_groups = [group.name for group in euser.in_group]
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   113
        if euser_groups:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   114
            self.w(u'<tr>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   115
        else:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   116
            self.w(u'<tr class="nogroup">')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   117
        self.w(u'<th><fieldset>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   118
        self.w(u'<input type="hidden" name="eid" value="%s" />' % euser.eid)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   119
        self.w(u'<input type="hidden" name="__type:%s" value="EUser" />' % euser.eid)
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   120
        # this should not occur (for now) since in_group relation is mandatory
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   121
        if not euser_groups:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   122
            self.w(u'<input type="hidden" name="edits-in_group:%s" value="%s">' %
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   123
                   (euser.eid, INTERNAL_FIELD_VALUE))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   124
        self.w(euser.dc_title())
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   125
        self.w(u'</fieldset></th>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   126
        for geid, gname in self.egroups:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   127
            self.w(u'<td><fieldset>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   128
            if gname in euser_groups:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   129
                self.w(u'<input type="hidden" name="edits-in_group:%s" value="%s" />' %
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   130
                       (euser.eid, geid))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   131
                self.w(u'<input type="checkbox" name="in_group:%s" value="%s" checked="checked" />' %
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   132
                       (euser.eid, geid))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   133
            else:
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   134
                self.w(u'<input type="checkbox" name="in_group:%s" value="%s" />' %
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   135
                       (euser.eid, geid))
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   136
            self.w(u'</fieldset></td>')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   137
        self.w(u'</tr>\n')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   138
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   139
        
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   140
    @property
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   141
    @cached
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   142
    def egroups(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   143
        groups = self.req.execute('Any G, N ORDERBY N WHERE G is EGroup, G name N')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   144
        return [(geid, gname) for geid, gname in groups.rows if gname != 'owners']
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   145
                
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   146