Find file
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (32 sloc) 1.05 KB
import logging, email
from datetime import tzinfo, datetime, timedelta
# This function recreates the SigninRecord table from scratch
# (May never need to be used again)
def init_records():
import main"Wiping old SigninRecord table.")
for s in main.SigninRecord.all():
s.delete()"Scanning signin table.")
count = {}
first = {}
last = {}
for signin in main.Signin.all().order("created"):
if not in first:
first[] = signin.created
if not in count:
count[] = 1
count[] += 1
last[] = signin.created"Populating SigninRecord table.")
for email in count:
main.SigninRecord(email=email, first_signin = first[email], last_signin=last[email], signins = count[email]).put()"Done.")
class Pacific(tzinfo):
def utcoffset(self,dt):
return timedelta(hours=-8,minutes=0)
def tzname(self,dt):
return "GMT -8"
def dst(self,dt):
return timedelta(0)