accountant-ui/api/model/accounts.py
2013-12-03 22:22:49 +01:00

28 lines
1.0 KiB
Python

"""
This file is part of Accountant.
Accountant is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Foobar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
"""
from . import db
class Account(db.Model):
id = db.Column(db.Integer, primary_key = True)
name = db.Column(db.String(200), nullable = False)
authorized_overdraft = db.Column(db.Integer, nullable = True, default = 0)
def __init__(self, name, authorized_overdraft):
self.name = name
self.authorized_overdraft = authorized_overdraft