def __init__(self, *args, **kwargs): super(LoginForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_method = "post" self.helper.form_action = "login" self.helper.label_class = "sr-only" self.helper.layout = Layout( PrependedText("username", glyphicon("user"), placeholder="Username", css_class="full_width"), PrependedText("password", glyphicon("lock"), placeholder="Password"), Field("remember_me", css_class="checkbox-inline"), Submit("submit", "Login"), )
def __init__(self, *args, **kwargs): super(SignupForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_class = "form-horizontal" self.helper.form_method = "post" self.helper.form_action = "signup" self.helper.label_class = "col-lg-1" self.helper.field_class = "col-lg-12" self.helper.label_class = "sr-only" self.helper.layout = Layout( PrependedText("username", glyphicon("user"), placeholder="Username"), PrependedText("password1", glyphicon("lock"), placeholder="Password"), PrependedText("password2", glyphicon("repeat"), placeholder="Repeat Password"), Submit("submit", "Sign Up"), )