Initial commit
This commit is contained in:
13
App/Queries/category_list.py
Normal file
13
App/Queries/category_list.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import db.DBconnect
|
||||
|
||||
sql_provider = 1
|
||||
""" def select_list(db_config, sql):
|
||||
with DBContextManager(db_config) as cursor:
|
||||
if cursor is None:
|
||||
raise ValueError("Cursor not created")
|
||||
else:
|
||||
cursor.execute(sql)
|
||||
result = cursor.fetchall()
|
||||
schema = [item[0] for item in cursor.description]
|
||||
lst = [dict(zip(schema, row)) for row in result]
|
||||
return schema, lst """
|
||||
11
App/Queries/req.py
Normal file
11
App/Queries/req.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from flask import request, Blueprint, render_template, session, redirect, url_for
|
||||
from os import path
|
||||
from db.sql_provider import SQLProvider
|
||||
|
||||
sql_provider = SQLProvider(path.join(path.dirname(__file__), 'sql'))
|
||||
requests_bp = Blueprint('requests_bp', __name__, template_folder='templates')
|
||||
|
||||
@requests_bp.route('/', methods=['GET', 'POST'])
|
||||
def sklad_zapros():
|
||||
if request.method == 'GET':
|
||||
return render_template('sklad_zapros.html')
|
||||
17
App/Queries/templates/sklad_zapros.html
Normal file
17
App/Queries/templates/sklad_zapros.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Hello World</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World</h1>
|
||||
<form action="" method="post">
|
||||
<select name="categories" size="10" multiple>
|
||||
{% for category in categories %}
|
||||
<option value="{{ category }}">{{ category }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user