Skip to content

Commit b668e20

Browse files
authored
Merge pull request #146 from SmoFlaDru/dev-benno
Fix bug preventing auto increment column from working.
2 parents 6a09fd3 + 4ea84c5 commit b668e20

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

spybot/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class Meta:
140140

141141

142142
class TSUserActivity(DebuggableModel):
143-
id = models.IntegerField(primary_key=True)
143+
id = models.AutoField(primary_key=True)
144144
tsuser = models.ForeignKey(TSUser, models.DO_NOTHING, db_column='tsuserid', blank=True, null=True) # Field name made lowercase.
145145
start_time = models.DateTimeField(db_column='starttime', blank=True, null=True) # Field name made lowercase.
146146
end_time = models.DateTimeField(db_column='endtime', blank=True, null=True) # Field name made lowercase.

spybot/visualization.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def time_of_day_histogram():
5656
cursor.execute("""
5757
SELECT TO_CHAR(datetime, 'HH24') AS hour, AVG(activity_hours) AS amplitude
5858
FROM HourlyActivity
59-
GROUP BY hour;
59+
GROUP BY hour
60+
ORDER BY hour;
6061
""")
6162
return cursor.fetchall()
6263

0 commit comments

Comments
 (0)