Ejemplo n.º 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.num_entries = dataset_entries(None)
        return templating.render('home/index.html')
Ejemplo n.º 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')
Ejemplo n.º 3
0
 def index(self, dataset, format='html'):
     self._get_dataset(dataset)
     require.dataset.update(c.dataset)
     c.entries_count = len(c.dataset)
     c.has_sources = c.dataset.sources.count() > 0
     c.source = c.dataset.sources.first()
     c.index_count = solr.dataset_entries(c.dataset.name)
     c.index_percentage = 0 if not c.entries_count else \
         int((float(c.index_count) / float(c.entries_count)) * 1000)
     return render('editor/index.html')
Ejemplo n.º 4
0
 def index(self, dataset, format='html'):
     self._get_dataset(dataset)
     require.dataset.update(c.dataset)
     c.entries_count = len(c.dataset)
     c.has_sources = c.dataset.sources.count() > 0
     c.source = c.dataset.sources.first()
     c.index_count = solr.dataset_entries(c.dataset.name)
     c.index_percentage = 0 if not c.entries_count else \
         int((float(c.index_count)/float(c.entries_count))*1000)
     return render('editor/index.html')
Ejemplo n.º 5
0
 def test_dataset_entries(self):
     self.mock_solr.return_value.raw_query.return_value = '{"response":{"numFound":42}}'
     h.assert_equal(solr.dataset_entries('foo'), 42)
Ejemplo n.º 6
0
 def index(self):
     c.blog = ContentResource('blog', 'home.html')
     c.num_entries = dataset_entries(None)
     return templating.render('home/index.html')
Ejemplo n.º 7
0
 def test_dataset_entries(self):
     self.mock_solr.return_value.raw_query.return_value = \
         '{"response":{"numFound":42}}'
     assert solr.dataset_entries('foo') == 42
Ejemplo n.º 8
0
 def test_dataset_entries(self):
     self.mock_solr.return_value.raw_query.return_value = \
         '{"response":{"numFound":42}}'
     assert solr.dataset_entries('foo') == 42
Ejemplo n.º 9
0
 def test_dataset_entries(self):
     self.mock_solr.return_value.raw_query.return_value = '{"response":{"numFound":42}}'
     h.assert_equal(solr.dataset_entries('foo'), 42)