Docstring, pylint.
This commit is contained in:
parent
85468abe58
commit
0d61377280
@ -24,7 +24,7 @@ from . import db
|
|||||||
|
|
||||||
# pylint: disable=too-many-instance-attributes
|
# pylint: disable=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
|
# pylint: disable=invalid-name
|
||||||
id = db.Column(db.Integer, primary_key=True)
|
id = db.Column(db.Integer, primary_key=True)
|
||||||
|
|
||||||
@ -94,6 +94,7 @@ 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):
|
||||||
@ -109,6 +110,7 @@ class Operation(db.Model):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def query(cls, begin=None, end=None):
|
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
|
# We have to use a join because the sold is not computed from the
|
||||||
# begining.
|
# begining.
|
||||||
base_query = db.session.query(
|
base_query = db.session.query(
|
||||||
@ -146,6 +148,7 @@ class Operation(db.Model):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_categories_for_range(cls, account, begin, end):
|
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):
|
if isinstance(account, int) or isinstance(account, str):
|
||||||
account_id = account
|
account_id = account
|
||||||
else:
|
else:
|
||||||
@ -178,6 +181,7 @@ class Operation(db.Model):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_ohlc_per_day_for_range(cls, account, begin=None, end=None):
|
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):
|
if isinstance(account, int) or isinstance(account, str):
|
||||||
account_id = account
|
account_id = account
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user