Initial commit.
This commit is contained in:
58
subathons/data.py
Normal file
58
subathons/data.py
Normal file
@@ -0,0 +1,58 @@
|
||||
from data import Registry, RowModel, Table
|
||||
from data.columns import String, Timestamp, Integer, Bool
|
||||
|
||||
# User contributed {} subs and added {}:{} to the timer! Thank you :love:
|
||||
# We have reached goal #5: Karaoke !! Thank you everyone for your support <3
|
||||
|
||||
class Subathon(RowModel):
|
||||
_tablename_ = 'subathons'
|
||||
_cache_ = {}
|
||||
|
||||
subathon_id = Integer(primary=True)
|
||||
communityid = Integer()
|
||||
started_at = Timestamp()
|
||||
initial_time = Integer() # Initial number of seconds
|
||||
sub1_score = Integer()
|
||||
sub2_score = Integer()
|
||||
sub3_score = Integer()
|
||||
bit_score = Integer()
|
||||
score_time = Integer() # Conversion factor score to seconds
|
||||
duration = Integer()
|
||||
ended_at = Timestamp()
|
||||
timecap = Integer() # Maximum subathon duration in seconds
|
||||
|
||||
class RunningSubathon(RowModel):
|
||||
_tablename_ = 'running_subathons'
|
||||
_cache_ = {}
|
||||
|
||||
subathon_id = Integer(primary=True)
|
||||
last_started = Timestamp()
|
||||
|
||||
class SubathonContribution(RowModel):
|
||||
_tablename_ = 'subathon_contributions'
|
||||
_cache_ = {}
|
||||
|
||||
contribution_id = Integer(primary=True)
|
||||
subathon_id = Integer()
|
||||
profileid = Integer()
|
||||
score = Integer()
|
||||
event_id = Integer()
|
||||
# TODO: Should add a created timestamp here, since not all contributions have event ids
|
||||
|
||||
class SubathonGoal(RowModel):
|
||||
_tablename_ = 'subathon_goals'
|
||||
_cache_ = {}
|
||||
|
||||
goal_id = Integer(primary=True)
|
||||
subathon_id = Integer()
|
||||
required_score = Integer()
|
||||
description = String()
|
||||
notified = Bool()
|
||||
created_at = Timestamp()
|
||||
|
||||
|
||||
class SubathonData(Registry):
|
||||
subathons = Subathon.table
|
||||
running_subathons = RunningSubathon.table
|
||||
subathon_contributions = SubathonContribution.table
|
||||
subathon_goals = SubathonGoal.table
|
||||
Reference in New Issue
Block a user