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 swtstore.classes.models import Sweet, User |
9 |
|
10 |
|
11 |
frontend = Module(__name__) |
12 |
|
13 |
@frontend.route('/', methods=['GET']) |
14 |
def index(): |
15 |
sweets = Sweet.getFrontendSwts() |
16 |
sweets = [sweet.to_dict() for sweet in sweets] |
17 |
|
18 |
return render_template('frontend/index.html', sweets=sweets) |
19 |
|
20 |
|
21 |
# Create a new sweet context |
22 |
@frontend.route('/contexts/create', methods=['GET', 'POST']) |
23 |
def createContext(): |
24 |
pass |