2019-04-11 21:56:55 +00:00
|
|
|
from geruecht import db
|
|
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
class CreditList(db.Model):
|
2019-04-17 12:46:46 +00:00
|
|
|
""" DataBase Object Credit List:
|
|
|
|
|
|
|
|
Attributes:
|
|
|
|
id: id in Database. Is the Primary Key
|
|
|
|
<month>_guthaben: Credit of the Month.
|
|
|
|
<month>_schulden: Debt of the Month.
|
|
|
|
|
|
|
|
last_schulden: Debt or Credit of last Year.
|
|
|
|
year: Year of all Credits and Debts.
|
|
|
|
|
|
|
|
TODO: link to user???
|
|
|
|
"""
|
2019-04-11 21:56:55 +00:00
|
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
|
|
|
|
|
|
jan_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
jan_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
feb_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
feb_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
maer_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
maer_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
apr_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
apr_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
mai_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
mai_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
jun_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
jun_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
jul_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
jul_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
aug_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
aug_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
sep_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
sep_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
okt_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
okt_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
nov_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
nov_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
dez_guthaben = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
dez_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
last_schulden = db.Column(db.Integer, nullable=False, default=0)
|
|
|
|
|
|
|
|
year = db.Column(db.Integer, nullable=False, default=datetime.now().year)
|