diff --git a/app/__init__.py b/app/__init__.py index 0c6bb6a..4c3a915 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -75,14 +75,14 @@ def create_app(): if cdclient is not None: cdclient.close() - @app.errorhandler(Exception) - def handle_exception(e): - app.logger.error(e) - # pass through HTTP errors - if isinstance(e, HTTPException): - return e - # now you're handling non-HTTP exceptions only - return render_template("status_codes/500.html.j2", exception=e), 500 + # @app.errorhandler(Exception) + # def handle_exception(e): + # app.logger.error(e) + # # pass through HTTP errors + # if isinstance(e, HTTPException): + # return e + # # now you're handling non-HTTP exceptions only + # return render_template("status_codes/500.html.j2", exception=e), 500 # add the commands to flask cli app.cli.add_command(init_db) diff --git a/app/models.py b/app/models.py index 2e42c7e..47910bb 100644 --- a/app/models.py +++ b/app/models.py @@ -8,6 +8,7 @@ from flask_sqlalchemy import BaseQuery from sqlalchemy.dialects import mysql from sqlalchemy.exc import OperationalError, StatementError from sqlalchemy.types import JSON +from sqlalchemy.ext.hybrid import hybrid_property from time import sleep import random import string @@ -694,6 +695,15 @@ class Property(db.Model): nullable=False, ) + performance_cost = db.Column( + mysql.DOUBLE( + precision=20, + scale=15, + asdecimal=False + ), + server_default='0.0' + ) + zone_id = db.Column( mysql.INTEGER, nullable=False, diff --git a/app/properties.py b/app/properties.py index 5e0337b..bbf1877 100644 --- a/app/properties.py +++ b/app/properties.py @@ -123,8 +123,9 @@ def get(status="all"): ColumnDT(Property.time_claimed), # 9 ColumnDT(Property.rejection_reason), # 10 ColumnDT(Property.reputation), # 11 - ColumnDT(Property.zone_id), # 12 - ColumnDT(Account.username) # 13 + ColumnDT(Property.performance_cost), # 12 + ColumnDT(Property.zone_id), # 13 + ColumnDT(Account.username) # 14 ] query = None @@ -146,6 +147,7 @@ def get(status="all"): rowTable = DataTables(params, query, columns) data = rowTable.output_result() + print(data) for property_data in data["data"]: id = property_data["0"] @@ -181,7 +183,7 @@ def get(status="all"): if property_data["4"] == "": property_data["4"] = query_cdclient( 'select DisplayDescription from ZoneTable where zoneID = ?', - [property_data["12"]], + [property_data["13"]], one=True ) @@ -200,9 +202,9 @@ def get(status="all"): else: property_data["7"] = '''
''' - property_data["12"] = query_cdclient( + property_data["13"] = query_cdclient( 'select DisplayDescription from ZoneTable where zoneID = ?', - [property_data["12"]], + [property_data["13"]], one=True ) diff --git a/app/templates/partials/_property.html.j2 b/app/templates/partials/_property.html.j2 index 14012a9..a6fa785 100644 --- a/app/templates/partials/_property.html.j2 +++ b/app/templates/partials/_property.html.j2 @@ -69,6 +69,14 @@ {{ property.reputation }} +