Docstring, pylint.

This commit is contained in:
Alexis Lahouze 2017-05-07 22:23:36 +02:00
parent 85468abe58
commit 0d61377280

View File

@ -24,7 +24,7 @@ from . import db
# pylint: disable=too-many-instance-attributes
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)
@ -94,6 +94,7 @@ class Operation(db.Model):
).label("sold")
)
# pylint: disable=too-many-arguments
def __init__(self, label, value, account_id, operation_date=None,
category=None, pointed=False, confirmed=True, canceled=False,
scheduled_operation_id=None):
@ -109,6 +110,7 @@ class Operation(db.Model):
@classmethod
def query(cls, begin=None, end=None):
"""Return query for this class."""
# We have to use a join because the sold is not computed from the
# begining.
base_query = db.session.query(
@ -146,6 +148,7 @@ class Operation(db.Model):
@classmethod
def get_categories_for_range(cls, account, begin, end):
"""Get category list for a specific time period."""
if isinstance(account, int) or isinstance(account, str):
account_id = account
else:
@ -178,6 +181,7 @@ class Operation(db.Model):
@classmethod
def get_ohlc_per_day_for_range(cls, account, begin=None, end=None):
"""Get Opening, High, Low, Closing per day for a specific range"""
if isinstance(account, int) or isinstance(account, str):
account_id = account
else: