Created
January 27, 2021 00:53
-
-
Save Ramko9999/4525e7edf7d2bf6802e516eba6f1fd89 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from app import db | |
class Day(db.Model): | |
__tablename__ = 'day' | |
id = db.Column('id', db.Date(), primary_key=True) | |
views = db.Column('views', db.Integer) | |
reads = db.Column('reads', db.Integer) | |
def __init__(self, id, views, reads): | |
self.id = id | |
self.views = views | |
self.reads = reads | |
def serialize(self): | |
return { | |
"id": self.id, | |
"views": self.views, | |
"reads": self.reads | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment