def get_user_projects(cls, user): gids = [g.id for g in Group.query_by_uid(user.get_id())] return Project.query.filter(Project.id_group.in_(gids))
def new_login(self, uid, force=False): from lw_daap.modules.invenio_groups.models import Group data = old_login(self, uid, force) data['group'] = map(lambda x: x.name, Group.query_by_uid(uid)) return data