Skip to content
This repository was archived by the owner on Oct 18, 2019. It is now read-only.

Commit b422076

Browse files
committed
Merge pull request #377 from lukecampbell/harvesting
Updates landing page to show UNIQUE datasets
2 parents bfe5d05 + 8214be2 commit b422076

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Diff for: ioos_catalog/models/dataset.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,12 @@ def total_datasets(cls):
123123
counts = cls.count_types_by_provider()
124124
vals = [ v['_all'] for v in counts.itervalues() ]
125125
return sum(vals)
126-
126+
127+
@classmethod
128+
def total_unique_datasets(cls):
129+
'''
130+
Returns the total unique datasets
131+
'''
132+
counts = db.datasets.distinct('uid')
133+
return len(counts)
134+

Diff for: ioos_catalog/views/landing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def index():
1111
@app.route('/landing', methods=['GET'])
1212
@app.route('/landing/', methods=['GET'])
1313
def landing():
14-
total_datasets = db.Dataset.total_datasets()
14+
total_datasets = db.Dataset.total_unique_datasets()
1515
total_services = db.Service.find({"active":True}).count()
1616
return render_template('landing.html', total_datasets=total_datasets, total_services=total_services)
1717

0 commit comments

Comments
 (0)