-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmodels.py
More file actions
27 lines (20 loc) · 845 Bytes
/
models.py
File metadata and controls
27 lines (20 loc) · 845 Bytes
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
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class MonthlyCustomers(db.Model):
id = db.Column(db.Integer, primary_key=True)
month_name = db.Column(db.String(8), nullable=False, unique=True)
customer_count = db.Column(db.Integer)
def __repr__(self):
return f"{self.month_name : self.customer_count}"
class MonthlySales(db.Model):
id = db.Column(db.Integer, primary_key=True)
month_name = db.Column(db.String(8), nullable=False, unique=True)
sale = db.Column(db.Integer)
def __repr__(self):
return f"{self.month_name : self.sale}"
class ProductSales(db.Model):
id = db.Column(db.Integer, primary_key=True)
product = db.Column(db.String(50), nullable=False, unique=True)
sale = db.Column(db.Integer)
def __repr__(self):
return f"{self.product : self.sale}"