|
@ -1,4 +1,5 @@ |
|
|
from flask import Blueprint, render_template |
|
|
from flask import Blueprint, render_template, redirect, url_for |
|
|
|
|
|
from flask_login import current_user |
|
|
from models.distribusi_model import Distribusis |
|
|
from models.distribusi_model import Distribusis |
|
|
from models.distribusi_file_model import DistribusiFiles |
|
|
from models.distribusi_file_model import DistribusiFiles |
|
|
|
|
|
|
|
@ -12,11 +13,12 @@ describer = Blueprint( |
|
|
|
|
|
|
|
|
@describer.route("/<string:distribusiname>") |
|
|
@describer.route("/<string:distribusiname>") |
|
|
def describe_distribusi_files(distribusiname): |
|
|
def describe_distribusi_files(distribusiname): |
|
|
|
|
|
if not current_user.is_authenticated: |
|
|
|
|
|
return redirect(url_for("index")) |
|
|
distribusi = Distribusis.query.filter_by( |
|
|
distribusi = Distribusis.query.filter_by( |
|
|
distribusiname=distribusiname |
|
|
distribusiname=distribusiname |
|
|
).first() |
|
|
).first() |
|
|
distribusi_files = DistribusiFiles.query.filter_by( |
|
|
distribusi_files = DistribusiFiles.query.filter_by( |
|
|
distribusi=distribusi.id |
|
|
distribusi=distribusi.id |
|
|
).all() |
|
|
).all() |
|
|
print(distribusi_files) |
|
|
|
|
|
return render_template("describe.html", distribusi_files=distribusi_files) |
|
|
return render_template("describe.html", distribusi_files=distribusi_files) |
|
|