def printer(): if request.method == 'POST': from project.models.Printer import Printer printer = Printer() message = printer.show_string(request.forms.get('text')) return template('printer/index', message = message) return template('printer/print', message = '')
def printer(): if request.method == 'POST': from project.models.Printer import Printer printer = Printer() message = printer.show_string(request.forms.get('text')) return template('printer/index', message=message) return template('printer/print', message='')
def printer(): form = CreateForm(request.form) if request.method == 'POST' and form.validate(): from project.models.Printer import Printer printer = Printer() printer.show_string(form.text.data) return render_template('printer/index.html') return render_template('printer/print.html', form=form)
def printer(): form = CreateForm(request.form) print form.errors if request.method == 'POST': text = request.form['text'] if form.validate(): from project.models.Printer import Printer printer = Printer() printer.show_string(form.text.data) #tutaj można coś z tymi danymi zrobić, np dodać je do bazki :) return render_template('printer/index.html') return render_template('printer/print.html', form=form)
def index(): from project.models.Printer import Printer printer = Printer() rows = printer.show_list() print rows return template('printer/index', rows=rows)