From db53f7e7c171a255955efb7b78675ad2c80c15fc Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Wed, 27 Sep 2017 16:47:56 +0200 Subject: [PATCH] default config for registration form added --- ordr2/schemas/account.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ordr2/schemas/account.py b/ordr2/schemas/account.py index ab0f812..2fe4ece 100644 --- a/ordr2/schemas/account.py +++ b/ordr2/schemas/account.py @@ -12,7 +12,8 @@ class RegistrationSchema(CSRFSchema): user_name = colander.SchemaNode( colander.String(), - widget=deform.widget.TextInputWidget(readonly=True), + widget=deform.widget.TextInputWidget(disabled=True), + description='automagically generated for you' ) first_name = colander.SchemaNode( colander.String() @@ -28,3 +29,13 @@ class RegistrationSchema(CSRFSchema): colander.String(), 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) +