This commit is contained in:
Alexis Lahouze 2017-05-19 16:58:20 +02:00
parent 6c3f73cd75
commit 01a509d348
4 changed files with 7 additions and 12 deletions

View File

@ -2,15 +2,14 @@
# vim: set tw=80 ts=4 sw=4 sts=4: # vim: set tw=80 ts=4 sw=4 sts=4:
# pylint: disable=no-member,too-few-public-methods
from . import db from . import db
from .operations import Operation from .operations import Operation
# pylint: disable=no-member,invalid-name,too-few-public-methods,no-self-use
class Account(db.Model): class Account(db.Model):
"""Model class to handle accounts.""" """Model class to handle accounts."""
# pylint: disable=invalid-name
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(200), nullable=False) name = db.Column(db.String(200), nullable=False)
authorized_overdraft = db.Column(db.Integer, nullable=True, default=0) authorized_overdraft = db.Column(db.Integer, nullable=True, default=0)
@ -87,7 +86,6 @@ class Account(db.Model):
return query.one() return query.one()
@db.validates('authorized_overdraft') @db.validates('authorized_overdraft')
# pylint: disable=no-self-use
def validate_authorized_overdraft(self, key, authorized_overdraft): def validate_authorized_overdraft(self, key, authorized_overdraft):
"""Validator for authorized_overdraft : must be negative.""" """Validator for authorized_overdraft : must be negative."""
del key del key

View File

@ -6,14 +6,13 @@ from datetime import date
import arrow import arrow
# pylint: disable=no-member,too-few-public-methods
from . import db from . import db
# pylint: disable=too-many-instance-attributes # pylint: disable=no-member,invalid-name,too-many-arguments
# pylint: disable=too-few-public-methods,too-many-instance-attributes
class Operation(db.Model): class Operation(db.Model):
"""Class used to handle operations.""" """Class used to handle operations."""
# pylint: disable=invalid-name
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
operation_date = db.Column( operation_date = db.Column(
@ -82,7 +81,6 @@ class Operation(db.Model):
).label("sold") ).label("sold")
) )
# pylint: disable=too-many-arguments
def __init__(self, label, value, account_id, operation_date=None, def __init__(self, label, value, account_id, operation_date=None,
category=None, pointed=False, confirmed=True, canceled=False, category=None, pointed=False, confirmed=True, canceled=False,
scheduled_operation_id=None): scheduled_operation_id=None):

View File

@ -6,16 +6,16 @@ from calendar import monthrange
import arrow import arrow
# pylint: disable=no-member,too-few-public-methods,too-many-instance-attributes
from . import db from . import db
from .accounts import Account from .accounts import Account
from .operations import Operation from .operations import Operation
# pylint: disable=no-member,invalid-name,too-many-arguments
# pylint: disable=too-few-public-methods,too-many-instance-attributes
class ScheduledOperation(db.Model): class ScheduledOperation(db.Model):
"""Class used to handle scheduled operations.""" """Class used to handle scheduled operations."""
# pylint: disable=invalid-name
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
start_date = db.Column(db.Date, nullable=False) start_date = db.Column(db.Date, nullable=False)
@ -39,7 +39,6 @@ class ScheduledOperation(db.Model):
backref=db.backref('scheduled_operation', lazy="dynamic") backref=db.backref('scheduled_operation', lazy="dynamic")
) )
# pylint: disable=too-many-arguments
def __init__(self, start_date, stop_date, day, frequency, label, value, def __init__(self, start_date, stop_date, day, frequency, label, value,
account_id, category=None): account_id, category=None):
self.start_date = start_date self.start_date = start_date

View File

@ -7,10 +7,10 @@ from passlib.hash import sha256_crypt as crypt
from . import db from . import db
# pylint: disable=no-member,too-few-public-methods # pylint: disable=no-member,invalid-name
# pylint: disable=too-few-public-methods,too-many-instance-attributes
class User(db.Model): class User(db.Model):
"""Class used to handle users.""" """Class used to handle users."""
# pylint: disable=invalid-name
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(200), nullable=False, unique=True, index=True) email = db.Column(db.String(200), nullable=False, unique=True, index=True)
password = db.Column(db.String(100), nullable=True) password = db.Column(db.String(100), nullable=True)