This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
1 |
# -*- coding utf-8 -*- |
2 |
# classes/views/frontend.py |
3 |
|
4 |
|
5 |
from flask import Module, jsonify, request, render_template, redirect,\ |
6 |
url_for, g, current_app |
7 |
|
8 |
from sqlalchemy import desc |
9 |
|
10 |
from swtstore.classes.models import Sweet |
11 |
from swtstore.classes.models.um import User |
12 |
|
13 |
|
14 |
frontend = Module(__name__) |
15 |
|
16 |
@frontend.route('/', methods=['GET']) |
17 |
def index(): |
18 |
sweets = Sweet.getFrontendSwts() |
19 |
|
20 |
user = User.getCurrentUser() |
21 |
|
22 |
return render_template('frontend/index.html', sweets=sweets) |
23 |
|
24 |
|
25 |
# Create a new sweet context |
26 |
@frontend.route('/contexts/create', methods=['GET', 'POST']) |
27 |
def createContext(): |
28 |
pass |