Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Minor fixes to stats script.

  • Loading branch information...
commit 3bbe9b68e77ba8f3b3fa5d68fcb02c00ec3101f4 1 parent 5b7c46e
Max Goodman authored July 19, 2012

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  scripts/generate_stats.py
5  scripts/generate_stats.py
@@ -24,12 +24,13 @@ def get_id(*args, **kwargs):
24 24
     for kind in (Link, Comment):
25 25
         thing_table, data_table = get_thing_table(kind._type_id)
26 26
         first_id = get_id(kind.c._date > ranges['yesterday'][0], sort=asc('_date'))
27  
-        last_id = get_id(kind.c._date < ranges['yesterday'][1], sort=asc('_date'))
  27
+        last_id = get_id(kind.c._date < ranges['yesterday'][1], sort=desc('_date'))
28 28
         if not first_id or not last_id:
29 29
             continue
30 30
 
31 31
         q = sa.select([data_table.c.value, sa.func.count(data_table.c.value)],
32  
-                (data_table.c.thing_id > first_id & data_table.c.thing_id < last_id)
  32
+                (data_table.c.thing_id > first_id)
  33
+                    & (data_table.c.thing_id < last_id)
33 34
                     & (data_table.c.key == 'sr_id')
34 35
                     & (thing_table.c.thing_id == data_table.c.thing_id)
35 36
                     & (thing_table.c.spam == False),

0 notes on commit 3bbe9b6

Please sign in to comment.
Something went wrong with that request. Please try again.