def __init__(self, *args, **kwargs): PasswordChangeForm.__init__(self, *args, **kwargs) self.helper = FormHelper(self) self.helper.label_class = 'col-md-5' self.helper.field_class = 'col-md-7' self.helper.layout.append(HTML(u"""<div class="form-group row"> <div class="col-md-offset-5 col-md-7"> <button type="submit" class="btn btn-secondary">""" + _(u'Изменить') + """</button> </div> </div>"""))
def __init__(self, *args, **kwargs): PasswordChangeForm.__init__(self, *args, **kwargs) self.helper = FormHelper(self) self.helper.label_class = 'col-md-5' self.helper.field_class = 'col-md-7' self.helper.layout.append(HTML(u"""<div class="form-group row"> <div class="col-md-offset-5 col-md-7"> <button type="submit" class="btn btn-secondary">""" + _(u'Изменить') + """</button> </div> </div>"""))
def __init__(self, *args, **kwargs): PasswordChangeForm.__init__(self, *args, **kwargs) self.fields[ 'old_password'].help_text = "Please type in your old password" self.fields[ 'new_password1'].help_text = "Please type in your new password" self.fields['new_password2'].help_text = "Please type in your new password here one more " \ "time" for field in self.fields: # нужен javascript help_text = self.fields[field].help_text self.fields[field].help_text = None if help_text != '': self.fields[field].widget.attrs.update({ 'class': 'has-popover', 'data-content': help_text, 'data-placement': 'right', 'data-container': 'body' })