diff options
Diffstat (limited to 'nutriweb/controllers/eating.py')
-rw-r--r-- | nutriweb/controllers/eating.py | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/nutriweb/controllers/eating.py b/nutriweb/controllers/eating.py index 47e45cd..09de298 100644 --- a/nutriweb/controllers/eating.py +++ b/nutriweb/controllers/eating.py @@ -1,46 +1,31 @@ -# python import -import logging -# .. +# gettext import from gettext import gettext as _ -# make module -from flask import jsonify, Module, request -_module = Module(__name__) +# server import +from server.flask import app, logger, render, request, jsonify -# bewype import -from bewype.flask import app -# nutriweb import -from nutriweb.controllers.base import render as r - - -# get application logger -logger = logging.getLogger('nutriweb') - - -@_module.route('/eating', methods=['GET', 'POST']) -def index(): +@app.route('/eating', methods=['GET', 'POST']) +def eating(): if request.method == 'POST': if 'difficutly' in request.form: _word = request.form['difficutly'] elif 'difficutly-ajax' in request.form: _ajax_content = { - 'word': request.form['difficutly-ajax'] + 'word': request.form['difficutly-ajax'] } return jsonify(_ajax_content) else: _word = '??' else: - _word = 'null' - + _word = '_' + # .. _content = { - 'title': [_('Eating'), 'test'], + 'title': _('Eating'), 'other_dict': { 'word1': _word, 'word2': 'deux', } } - return r('nutriweb/eating.html', **_content) + return render('nutriweb/eating.html', **_content) -# do register -app.register_module(_module)
\ No newline at end of file |