コード例 #1
0
ファイル: groups.py プロジェクト: eklitzke/lexigraph
    def get(self):
        a, b, group_name = self.uri.lstrip('/').split('/')
        validate_name(group_name)
        group = maybe_one(model.AccessGroup.all()
                          .filter('name =', group_name)
                          .filter('account =', self.account))
        if not group:
            self.log.warning('No group seen with name = %s, account = %s' % (group_name, self.account))
            self.not_found()
        self.env['group'] = group

        self.env['users'] = sorted((users.get_by_id(x) for x in group.users), key=lambda x: x.nickname())
        self.log.info('env = %s' % (env,))
        self.render_template('edit_group.html')
コード例 #2
0
ファイル: groups.py プロジェクト: eklitzke/lexigraph
    def post(self):
        dataset_name = self.request.get('dataset_name')
        if not dataset_name:
            self.redirect('/new/dataset')
        validate_name(dataset_name)

        aggregate = self.request.get('aggregate')
        
        max_age = self.request.get('max_age')

        if not account_name:
            self.redirect('/account')
        else:
            model.Account.create(account_name, self.user)
            self.redirect('/dashboard')