Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor fixes to stats script.

  • Loading branch information...
commit 3bbe9b68e77ba8f3b3fa5d68fcb02c00ec3101f4 1 parent 5b7c46e
@chromakode chromakode authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 scripts/generate_stats.py
View
5 scripts/generate_stats.py
@@ -24,12 +24,13 @@ def get_id(*args, **kwargs):
for kind in (Link, Comment):
thing_table, data_table = get_thing_table(kind._type_id)
first_id = get_id(kind.c._date > ranges['yesterday'][0], sort=asc('_date'))
- last_id = get_id(kind.c._date < ranges['yesterday'][1], sort=asc('_date'))
+ last_id = get_id(kind.c._date < ranges['yesterday'][1], sort=desc('_date'))
if not first_id or not last_id:
continue
q = sa.select([data_table.c.value, sa.func.count(data_table.c.value)],
- (data_table.c.thing_id > first_id & data_table.c.thing_id < last_id)
+ (data_table.c.thing_id > first_id)
+ & (data_table.c.thing_id < last_id)
& (data_table.c.key == 'sr_id')
& (thing_table.c.thing_id == data_table.c.thing_id)
& (thing_table.c.spam == False),
Please sign in to comment.
Something went wrong with that request. Please try again.