예제 #1
0
    def index(self):
        # Get all of the datasets available to the account of the logged in
        # or an anonymous user (if c.account is None)
        c.datasets = Dataset.all_by_account(c.account)
        c.territories = DatasetTerritory.dataset_counts(c.datasets)

        c.num_entries = dataset_entries(None)
        return templating.render('home/index.html')
예제 #2
0
    def index(self):
        # Get all of the datasets available to the account of the logged in
        # or an anonymous user (if c.account is None)
        c.datasets = Dataset.all_by_account(c.account)
        c.territories = DatasetTerritory.dataset_counts(c.datasets)

        c.num_entries = dataset_entries(None)
        return templating.render('home/index.html')
예제 #3
0
def territory_index(datasets):
    """
    Get a list of territories by count of datasets
    """
    # Get a list of territories in the current list of datasets
    territories = DatasetTerritory.dataset_counts(datasets)
    # Return a list of territories as dicts with code, count, url and label
    return [{'code': code, 'count': count,
             'url': h.url_for(controller='dataset',
                              action='index', territories=code),
             'label': COUNTRIES.get(code, code)}
            for (code, count) in territories]
예제 #4
0
def territory_index(datasets):
    """
    Get a list of territories by count of datasets
    """
    # Get a list of territories in the current list of datasets
    territories = DatasetTerritory.dataset_counts(datasets)
    # Return a list of territories as dicts with code, count, url and label
    return [{
        'code':
        code,
        'count':
        count,
        'url':
        h.url_for(controller='dataset', action='index', territories=code),
        'label':
        COUNTRIES.get(code, code)
    } for (code, count) in territories]