-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
83 lines (63 loc) · 2.54 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
from app import db
class Users(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.String(), unique=False)
display_name = db.Column(db.String(), unique=True)
email = db.Column(db.String(), unique=False)
followers = db.Column(db.String(), unique=False)
created_at = db.Column(db.DateTime, unique=False)
updated_at = db.Column(db.DateTime, unique=False)
def __init__(self,user_id,display_name,email,followers,created_at,updated_at):
self.user_id = user_id
self.display_name = display_name
self.email = email
self.followers = followers
self.created_at = created_at
self.updated_at = updated_at
def __repr__(self):
return '<user_id %r>' % self.user_id
class UserRefreshToken(db.Model):
__tablename__ = 'user_refresh_token'
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.String(), unique=True)
refresh_token = db.Column(db.String(), unique=True)
stored_date = db.Column(db.DateTime, unique=False)
def __init__(self, user_id, refresh_token, stored_date):
self.user_id = user_id
self.refresh_token = refresh_token
self.stored_date = stored_date
def __repr__(self):
return '<Refresh Token %r>' % self.refresh_token
class UserPlaylists(db.Model):
__tablename__ = 'user_playlists'
id = db.Column(db.Integer, primary_key=True)
user_id = db.Column(db.String(), unique=False)
playlist_id = db.Column(db.String(), unique=True)
playlist_name = db.Column(db.String(), unique=False)
playlist_seed = db.Column(db.String(), unique=False)
seed_attributes = db.Column(db.String(), unique=False)
created_date = db.Column(db.DateTime, unique=False)
updated_date = db.Column(db.DateTime, unique=False)
def __init__(self,user_id,playlist_id,playlist_name,playlist_seed,seed_attributes,created_date,updated_date):
self.user_id = user_id
self.playlist_id = playlist_id
self.playlist_name = playlist_name
self.playlist_seed = playlist_seed
self.seed_attributes = seed_attributes
self.created_date = created_date
self.updated_date = updated_date
def __repr__(self):
return '<playlist_id %r>' % self.playlist_id
class ContactForm(db.Model):
__tablename__ = 'contact_form'
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(), unique=False)
comment = db.Column(db.String(), unique=False)
created_date = db.Column(db.DateTime, unique=False)
def __init__(self, email, comment, created_date):
self.email = email
self.comment = comment
self.created_date = created_date
def __repr__(self):
return '<Comment %r>' % self.comment