# Path: pynuts/view.py
# class BaseForm(Form):
# 
#     def handle_errors(self):
#         """Flash all the form errors."""
#         if self.errors:
#             for key, errors in self.errors.items():
#                 flask.flash(jinja2.Markup(
#                     u'<label for="%s">%s</label>: %s.' % (
#                         key, self[key].label.text, ', '.join(errors))),
#                     'error')


from wtforms import TextField, IntegerField
from wtforms.validators import Required
from pynuts.view import BaseForm
from application import nuts
import database



class EmployeeView(nuts.ModelView):
    model = database.Employee

    list_column = 'fullname'
    create_columns = ('name', 'firstname')


# Path: pynuts/view.py
# class BaseForm(Form):
# 
#     def handle_errors(self):
#         """Flash all the form errors."""
#         if self.errors:
#             for key, errors in self.errors.items():
#                 flask.flash(jinja2.Markup(
#                     u'<label for="%s">%s</label>: %s.' % (
#                         key, self[key].label.text, ', '.join(errors))),
#                     'error')


# Path: docs/example/simple/view.py
from wtforms import TextField, IntegerField
from wtforms.validators import Required
from pynuts.view import BaseForm
from application import nuts
import database




class EmployeeView(nuts.ModelView):
    model = database.Employee

    list_column = 'fullname'
    create_columns = ('name', 'firstname')


    class Form(BaseForm):