Makign corrections on field selection.
This commit is contained in:
parent
7e915423a3
commit
9d36d600bb
9 changed files with 1504 additions and 39 deletions
|
|
@ -1,10 +1,30 @@
|
|||
from flask import Blueprint, request, jsonify, render_template
|
||||
from flask import Blueprint, current_app, render_template, send_file
|
||||
from pathlib import Path
|
||||
|
||||
from crudkit.core.service import CRUDService
|
||||
from crudkit.core.spec import CRUDSpec
|
||||
from crudkit.ui.fragments import render_table
|
||||
|
||||
from ..db import get_session
|
||||
from ..models.work_log import WorkLog
|
||||
|
||||
bp_index = Blueprint("index", __name__)
|
||||
|
||||
def init_index_routes(app):
|
||||
|
||||
@bp_index.get("/")
|
||||
def index():
|
||||
return render_template("base.html")
|
||||
session = get_session()
|
||||
work_log_service = CRUDService(WorkLog, session)
|
||||
work_logs = work_log_service.list({"complete__ne": 1, "fields": ["start_time"]})
|
||||
print(work_logs)
|
||||
logs = render_table(work_logs)
|
||||
|
||||
return render_template("index.html", logs=logs)
|
||||
|
||||
@bp_index.get("/LICENSE")
|
||||
def license():
|
||||
path = Path(current_app.root_path).parent / "LICENSE"
|
||||
return send_file(path, mimetype="text/plain; charset=utf-8")
|
||||
|
||||
app.register_blueprint(bp_index)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue