# Path: solarpi/extensions.py



from datetime import timedelta, datetime
from flask import Blueprint, render_template
from solarpi.extensions import db, cache



blueprint = Blueprint("tables", __name__, url_prefix="/tables", static_folder="../static")


@blueprint.route("/")
@cache.cached(timeout=3600, key_prefix="tables")
def tables():
    """Renders a page with tabulated data for the last 30 days
    :return: a page with tabulated data
    """
    last_30_days = datetime.now() - timedelta(days=30)

# Path: solarpi/extensions.py



# Path: solarpi/tables/views.py
from datetime import timedelta, datetime
from flask import Blueprint, render_template
from solarpi.extensions import db, cache




blueprint = Blueprint("tables", __name__, url_prefix="/tables", static_folder="../static")


@blueprint.route("/")
@cache.cached(timeout=3600, key_prefix="tables")
def tables():
    """Renders a page with tabulated data for the last 30 days
    :return: a page with tabulated data
    """
    last_30_days = datetime.now() - timedelta(days=30)

    data = db.engine.execute(