Removed third parties to use CloudFlare CDN.
Added scheduling (missing database update) Using Jinja2 templates. Updated layout.
This commit is contained in:
@ -18,6 +18,7 @@ from app import app
|
||||
from app import db
|
||||
|
||||
from api.model.accounts import Account
|
||||
from api.model.scheduled_operations import ScheduledOperation
|
||||
|
||||
from sqlalchemy import func, desc
|
||||
from sqlalchemy.orm import column_property
|
||||
@ -30,17 +31,19 @@ class Entry(db.Model):
|
||||
label = db.Column(db.String(500), nullable = False)
|
||||
value = db.Column(db.Numeric(15, 2), nullable = False)
|
||||
account_id = db.Column(db.Integer, db.ForeignKey('account.id'))
|
||||
scheduled_operation_id = db.Column(db.Integer, db.ForeignKey('scheduled_operation.id'))
|
||||
|
||||
account = db.relationship(Account, backref = db.backref('entry', lazy="Dynamic"))
|
||||
scheduled_operation = db.relationship(ScheduledOperation, backref = db.backref('entry', lazy="Dynamic"))
|
||||
|
||||
category = db.Column(db.String(100), nullable = True)
|
||||
sold = column_property(func.sum(value).over(order_by="operation_date, value desc, label desc"))
|
||||
|
||||
def __init__(self, pointed, label, value, account_id, operation_date = None, category = None):
|
||||
def __init__(self, pointed, label, value, account_id, operation_date = None, category = None, scheduled_operation_id = None):
|
||||
self.pointed = pointed
|
||||
self.operation_date = operation_date
|
||||
self.label = label
|
||||
self.value = value
|
||||
self.account_id = account_id
|
||||
self.category = category
|
||||
self.scheduled_operation_id = scheduled_operation_id
|
||||
|
||||
|
Reference in New Issue
Block a user