def __before__(self, action, **params): account_name = request.environ.get('REMOTE_USER', None) if account_name: c.account = model.account.find_one_by('name', account_name) else: c.account = None i18n.handle_request(request, c) c.q = '' c.items_per_page = int(request.params.get('items_per_page', 20)) c.state = session.get('state', {}) c.datasets = model.db.session.query(model.Dataset).all() c.dataset = None
def __before__(self, action, **params): #from pprint import pprint #pprint(request.environ) c.account_name = request.environ.get('REMOTE_USER', None) if c.account_name: c.account = model.Account.by_name(c.account_name) else: c.account = None i18n.handle_request(request, c) c.q = '' c.items_per_page = int(request.params.get('items_per_page', 20)) c.state = session.get('state', {}) c.datasets = list(model.Dataset.find()) c.dataset = None self._detect_dataset_subdomain()