class BadgeForm(formencode.Schema): allow_extra_fields = True title = All(validators.String(max=40, not_empty=True), ContainsChar()) description = validators.String(max=255) color = ValidHTMLColor() group = Any(validators.Empty, ValidGroup()) display_group = validators.StringBoolean(if_missing=False) badge_delegateable = validators.StringBoolean(if_missing=False)
class NewFormValidator(Schema): username = validators.UnicodeString(not_empty=True) firstname = validators.UnicodeString(not_empty=True) lastname = validators.UnicodeString(not_empty=True) email = validators.UnicodeString(not_empty=True) password = validators.UnicodeString(not_empty=False) enabled = validators.StringBoolean(if_missing=False)
class ProfileForm(Schema): allow_extra_fields = True filter_extra_fields = True delete = validators.StringBoolean(if_missing=False) identifier = validators.OpenId(not_empty=True) name = validators.UnicodeString(not_empty=True, strip=True) email = validators.Email(not_empty=False, resolve_domain=True) website = validators.URL(add_http=True)
class PostForm(Schema): allow_extra_fields = True filter_extra_fields = True delete = validators.StringBoolean(if_missing=False) title = validators.UnicodeString(not_empty=True, strip=True) category_id = CategoryId() category_title = CategoryTitle() slug = validators.UnicodeString(strip=True) summary = validators.UnicodeString() content = validators.UnicodeString(not_empty=True, strip=True)
class NewUserSchema(AuthFormSchema): "Validate new users." allow_extra_fields = False username = UniqueUsername(not_empty=True) password = validators.String(if_missing=None) confirm_password = validators.String(if_missing=None) name = validators.String(not_empty=False) resident = validators.StringBoolean(not_empty=True) chained_validators = [ validators.FieldsMatch('password', 'confirm_password'), ]
class UserBadgeForm(BadgeForm): group = Any(validators.Empty, ValidInstanceGroup()) display_group = validators.StringBoolean(if_missing=False)
class CommentUserForm(Schema): allow_extra_fields = True filter_extra_fields = True comment = validators.UnicodeString(not_empty=True, strip=True) delete = validators.StringBoolean(if_missing=False)
class CategoryForm(Schema): allow_extra_fields = True filter_extra_fields = True delete = validators.StringBoolean(if_missing=False) title = CategoryTitle(not_empty=True, strip=True)