from flask import Blueprint, render_template, redirect, url_for from flask_login import current_user from models.distribusi_model import Distribusis from models.distribusi_file_model import DistribusiFiles describer = Blueprint( "describer", __name__, template_folder="templates/describe_files", static_folder="static", ) @describer.route("/") def describe_distribusi_files(distribusiname): if not current_user.is_authenticated: return redirect(url_for("index")) distribusi = Distribusis.query.filter_by( distribusiname=distribusiname ).first() distribusi_files = DistribusiFiles.query.filter_by( distribusi=distribusi.id ).all() return render_template("describe.html", distribusi_files=distribusi_files)