class DailyTotal(db.Model):
"""Define a DailyTotal for new issues filed.
An daily total has:
* a unique table id
* a day representing the date that corresponds to the total
* a count of the issues filed on this date
"""
id = db.Column(db.Integer, primary_key=True)
day = db.Column(db.DateTime, nullable=False)
count = db.Column(db.Integer, nullable=False)
def __repr__(self):
"""Representation of DailyTotal."""
return '<DailyTotal for {day}: {count}'.format(
day=self.day,
count=self.count
)
Potential "daily total" model: