-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
32 lines (27 loc) · 1.11 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from app import db
class state(db.Model):
statename=db.Column(db.VARCHAR(50),primary_key=True)
date=db.Column(db.DATE,primary_key=True)
dailyconf=db.Column(db.BIGINT)
dailyrec=db.Column(db.BIGINT)
dailydec=db.Column(db.BIGINT)
cumconf=db.Column(db.BIGINT)
cumact=db.Column(db.BIGINT)
cumrec=db.Column(db.BIGINT)
cumdec=db.Column(db.BIGINT)
def __init__(self,statename,date,dailyconf,dailyrec,dailydec,cumconf,cumact,cumrec,cumdec):
self.statename=statename
self.date=date
self.dailyconf=dailyconf
self.dailyrec=dailyrec
self.dailydec=dailydec
self.cumconf=cumconf
self.cumact=cumact
self.cumrec=cumrec
self.cumdec=cumdec
def __repr__(self):
return "state "+self.statename+" "+str(self.date)
def print(self):
print(self.statename,self.date,self.dailyconf,self.dailyrec,self.dailydec,self.cumconf,self.cumact,self.cumrec,self.cumdec)
def values(self):
return [self.statename,self.date,self.dailyconf,self.dailyrec,self.dailydec,self.cumconf,self.cumact,self.cumrec,self.cumdec]