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, render_template |
6 |
|
7 |
from swtstore.classes.models import Sweet |
8 |
|
9 |
|
10 |
frontend = Module(__name__) |
11 |
|
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 |