Exemplo n.º 1
0
 def get(self):
     conf_form = ConfigurationForm(obj=configuration_provider.actual)
     return render_template('admin_index.html',
                            games=game_controller.sorted_games(),
                            now=datetime.now(),
                            form=conf_form,
                            set=set,
                            TIMEOUT_DELETE=GameDetailView.TIMEOUT_DELETE)
Exemplo n.º 2
0
    def post(self, **kwargs):
        form = ConfigurationForm(data=kwargs)
        if form.validate():
            configuration_provider.actual = form.as_configuration
            return redirect(url_for('admin_index'))

        return render_template('admin_index.html',
                               games=game_controller.sorted_games(),
                               now=datetime.now(),
                               form=form,
                               set=set,
                               TIMEOUT_DELETE=GameDetailView.TIMEOUT_DELETE)