-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
40 lines (29 loc) · 1.28 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
33
34
35
36
37
38
39
40
from app import db
class songs(db.Model):
SongID = db.Column(db.Integer, primary_key=True)
ArtistID = db.Column(db.Integer)
Artist = db.Column(db.String(120))
Title = db.Column(db.String(120))
Genre = db.Column(db.String(25), primary_key=True)
Points = db.Column(db.Integer)
Date = db.Column(db.Date, primary_key=True)
def __repr__self(self):
return "%d, %s, %d\n" %(self.SongID, self.Genre, self.Points)
class artist_points(db.Model):
Artist = db.Column(db.String(120), primary_key=True)
ArtistID = db.Column(db.Integer)
Genre = db.Column(db.String(25), primary_key=True)
Points = db.Column(db.Integer)
def __repr__self(self):
return "%s, %d\n" %(self.Artist, self.Points)
class graphs(db.Model):
SongID = db.Column(db.String(120), primary_key=True)
URL = db.Column(db.String(120), primary_key=True)
def __repr__self(self):
return "%s, %s\n" % (self.SongID, self.URL)
class song_points(db.Model):
SongID = db.Column(db.Integer, primary_key=True)
ArtistID = db.Column(db.Integer)
Artist = db.Column(db.String(120))
Genre = db.Column(db.String(25), primary_key=True)
Points = db.Column(db.Integer)