from flask.ext.wtf import Form
from wtforms import StringField, TextAreaField, SubmitField, SelectField, \
                    DateTimeField
from wtforms.validators import Required, Length, Email, Optional

class ProfileForm(Form):
  name      = StringField('Nafn', validators=[Optional(),
                                              Length(1,64)])
  location  = StringField('Staðsetning', validators=[Optional(), 
                                                     Length(1,64)])
  bio       = TextAreaField('Um', validators=[Optional()])
  submit    = SubmitField('Breyta')

class PostForm(Form):
  title     = StringField('Titill', validators=[Required(), 
                                                Length(1,64)])
  created   = DateTimeField('Dagsetning', validators=[Optional()])
  post      = TextAreaField('Frétt', validators=[Required()])
  category  = SelectField('Flokkur', coerce=int, validators=[Optional()])
  submit    = SubmitField('Senda')

@@ -954,12 +954,432 @@
 ld('Senda')%0A
+%0Aclass CategoryForm(Form):%0A  category  = StringField('Nafn %C3%A1 Flokki', validators=%5BOptional()%5D)%0A  submit    = SubmitField('Senda', validators=%5BOptional()%5D)%0A  inactive  = SelectField('Flokkar sem ekki birtast', validators=%5BOptional()%5D)%0A  right     = SubmitField('%3E', validators=%5BOptional()%5D)%0A  left      = SubmitField('%3C', validators=%5BOptional()%5D)%0A  active    = SelectField('Flokkar sem birtast', validators=%5BOptional()%5D)%0A

Add a CategoryForm