Changeset - f99bd2c57c77
[Not reviewed]
default
0 1 0
Dennis Fink - 11 years ago 2014-07-13 16:43:34
dennis.fink@c3l.lu
remove uncommitted function imports
1 file changed with 2 insertions and 3 deletions:
0 comments (0 inline, 0 general)
ennstatus/stats/views.py
Show inline comments
 
from flask import (Blueprint, render_template, request, current_app,
 
                   redirect, url_for)
 

	
 
from ennstatus.stats.functions import (make_worldmap, make_total_pie,
 
                                       make_type_pie)
 
from ennstatus.stats.forms import (WorldmapStyleForm)
 
from ennstatus.stats.functions import make_worldmap
 
from ennstatus.stats.forms import WorldmapStyleForm
 

	
 
stats_page = Blueprint('stats', __name__)
 

	
 

	
 
@stats_page.route('/')
 
def index():
 
    return render_template('stats/index.html')
 

	
 

	
 
@stats_page.route('/worldmap', methods=('GET', 'POST'))
 
def worldmap():
 

	
 
    current_app.logger.info('Handling worldmap')
 
    form = WorldmapStyleForm()
 
    style_choices = [choice[0] for choice in form.style.choices]
 
    server_choices = [choice[0] for choice in form.server_type.choices]
 

	
 
    if request.method == 'POST':
 
        current_app.logger.debug('Validating form')
 
        if form.validate_on_submit():
 
            style = form.style.data
 
            server_type = form.server_type.data
 
            return redirect(url_for('stats.worldmap', server_type=server_type,
 
                                    style=style))
0 comments (0 inline, 0 general)