Count users for stats

This commit is contained in:
Ilya Zverev 2016-04-13 13:05:47 +03:00
parent 547ae15f3b
commit a03c20d28b
3 changed files with 4 additions and 1 deletions

View file

@ -1,7 +1,8 @@
import os.path, sys
import peewee
path = os.path.dirname(sys.argv[0]) if len(sys.argv) < 2 else sys.argv[1]
#path = os.path.dirname(sys.argv[0]) if len(sys.argv) < 2 else sys.argv[1]
path = os.path.dirname(sys.argv[0])
database = peewee.SqliteDatabase(os.path.join(path, 'mapsme-changes.db'))
class Change(peewee.Model):

View file

@ -144,6 +144,7 @@ def the_one_and_only_page():
elif stat.obj_type == 'r':
stats['relations'] += stat.count
stats['pages'] = (stats['total'] + config.PAGE_SIZE - 1) / config.PAGE_SIZE
stats['users'] = q['users'].count(clear_limit=True)
# List of dates for filtering
dates = []

View file

@ -15,6 +15,7 @@
<li>Nodes: {{ stats.nodes }}</li>
<li>Ways: {{ stats.ways }}</li>
<li>Relations: {{stats.relations }}</li>
<li>Users: {{stats.users }}</li>
</ul>
</div>
<div class="filter">