예제 #1
0
class Budget(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(60))
    budget = db.Column(db.Float)
    closed = db.Column(db.Boolean, default=False)
    term_id = db.Column(db.Integer, db.ForeignKey('term.id'))
    expenditures = db.relationship('Expenditure', backref='budget', lazy=True)
예제 #2
0
class Account(db.Model):
    account_id = db.Column(db.Integer, primary_key=True)
    holder_name = db.Column(db.String(30), nullable=False)
    account_type = db.Column(db.String(20), nullable=False, default='Resident')
    block_no = db.Column(db.String(1), nullable=True)
    phone_no = db.Column(db.String(10), nullable=False)
    flat_no = db.Column(db.Integer, nullable=True, unique=True)
    balance = db.Column(db.Float, default=0.0, nullable=False)
    transactions = db.relationship('Transactions',
                                   backref='ref_acc',
                                   lazy=True)
    init_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)

    def __repr__(self):
        return "Account('{}', '{}', '{}')".format(self.account_id,
                                                  self.account_type,
                                                  self.holder_name)
예제 #3
0
class Transactions(db.Model):
    trans_id = db.Column(db.Integer, primary_key=True)
    trans_user = db.Column(db.Integer,
                           db.ForeignKey('account.account_id'),
                           nullable=False)
    trans_amount = db.Column(db.Float, nullable=False)
    trans_date = db.Column(db.DateTime,
                           nullable=False,
                           default=datetime.utcnow)
    trans_mode = db.Column(db.String(10), nullable=False)
    trans_type = db.Column(db.String(10), nullable=False)
    trans_descr = db.Column(db.Text)

    def __repr__(self):
        return "Transcation('{}', '{}', '{}')".format(self.trans_id,
                                                      self.trans_user,
                                                      self.trans_mode)
예제 #4
0
class Fixedcost(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(60))
    price = db.Column(db.Float)
    payed = db.Column(db.Boolean)
    fixedcosttemplate_id = db.Column(db.Integer, db.ForeignKey('fixedcosttemplate.id'))
예제 #5
0
class Fixedcosttemplate(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(60))
    price = db.Column(db.Float)
    default = db.Column(db.Boolean)
예제 #6
0
class Expenditure(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(60))
    price = db.Column(db.Float)
    payed = db.Column(db.Boolean)
    budget_id = db.Column(db.Integer, db.ForeignKey('budget.id'))
예제 #7
0
class Term(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(60))
    income = db.Column(db.Float)
    budgets = db.relationship('Budget', backref='term', lazy=True)
예제 #8
0
class Budgettemplate(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(60))
    budget = db.Column(db.Float)