Browse Source

default config for registration form added

php2python
Holger Frey 7 years ago
parent
commit
db53f7e7c1
  1. 13
      ordr2/schemas/account.py

13
ordr2/schemas/account.py

@ -12,7 +12,8 @@ class RegistrationSchema(CSRFSchema):
user_name = colander.SchemaNode( user_name = colander.SchemaNode(
colander.String(), colander.String(),
widget=deform.widget.TextInputWidget(readonly=True), widget=deform.widget.TextInputWidget(disabled=True),
description='automagically generated for you'
) )
first_name = colander.SchemaNode( first_name = colander.SchemaNode(
colander.String() colander.String()
@ -28,3 +29,13 @@ class RegistrationSchema(CSRFSchema):
colander.String(), colander.String(),
widget=deform.widget.CheckedPasswordWidget() widget=deform.widget.CheckedPasswordWidget()
) )
@classmethod
def as_form(cls, request, **override):
settings = {
'buttons': ('Create Account', 'Cancel'),
'css_class': 'form-horizontal'
}
settings.update(override)
return super().as_form(request, **settings)