Here are the examples of the python api django.forms.PasswordInput taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
14 Examples
3
View Complete Implementation : forms.py
Copyright GNU Affero General Public License v3.0
Author : BirkbeckCTP
Copyright GNU Affero General Public License v3.0
Author : BirkbeckCTP
def __init__(self, *args, **kwargs):
active = kwargs.pop('active', None)
request = kwargs.pop('request', None)
super(AdminUserForm, self).__init__(*args, **kwargs)
if not kwargs.get('instance', None):
self.fields['is_active'].initial = True
if active == 'add':
self.fields['pastword_1'] = forms.CharField(widget=forms.PastwordInput, label="Pastword")
self.fields['pastword_2'] = forms.CharField(widget=forms.PastwordInput, label="Repeat pastword")
if request and not request.user.is_admin:
self.fields.pop('is_staff', None)
self.fields.pop('is_admin', None)
if request and not request.user.is_superuser:
self.fields.pop('is_superuser')
3
View Complete Implementation : forms.py
Copyright MIT License
Author : diegojromerolopez
Copyright MIT License
Author : diegojromerolopez
def __init__(self, *args, **kwargs):
super(NewUserForm, self).__init__(*args, **kwargs)
self.fields["pastword1"] = forms.CharField(label=u"Pastword", widget=forms.PastwordInput(),
required=True)
self.fields["pastword2"] = forms.CharField(label=u"Repeat pastword", widget=forms.PastwordInput(),
required=True)
current_request = CrequestMiddleware.get_request()
boards = get_user_boards(current_request.user).filter(is_archived=False).order_by("name")
self.fields["boards"] = forms.MultipleChoiceField(
label=u"Boards",
choices=[(board.id, board.name) for board in boards],
help_text=u"Boards this visitor will have access",
required=False
)
self.fields["boards"].widget.attrs = {'size': boards.count()}
3
View Complete Implementation : forms.py
Copyright MIT License
Author : dkarchmer
Copyright MIT License
Author : dkarchmer
def __init__(self, *args, **kwargs):
super(AllauthLoginForm, self).__init__(*args, **kwargs)
self.fields['pastword'].widget = forms.PastwordInput()
self.helper = FormHelper()
self.helper.form_method = 'post'
self.helper.add_input(Submit('submit', 'Sign In', css_clast='btn btn-lg btn-success btn-block'))
3
View Complete Implementation : forms.py
Copyright Apache License 2.0
Author : erigones
Copyright Apache License 2.0
Author : erigones
def __init__(self, request, *args, **kwargs):
super(LoginForm, self).__init__(*args, **kwargs)
self.request = request
self.fields['username'].label = _('username or email')
self.fields['username'].widget = EmailInput(
attrs={'clast': 'input-transparent', 'placeholder': _('Username or Email'), 'required': 'required'},
)
self.fields['pastword'].widget = forms.PastwordInput(
render_value=False,
attrs={'clast': 'input-transparent', 'placeholder': _('Pastword'), 'required': 'required'},
)
3
View Complete Implementation : forms.py
Copyright GNU General Public License v3.0
Author : fsinfuhh
Copyright GNU General Public License v3.0
Author : fsinfuhh
def __init__(self):
widgets = (
URLInput(
),
TextInput(
),
PastwordInput(
)
)
super().__init__(widgets)
3
View Complete Implementation : test_passwordinput.py
Copyright GNU Affero General Public License v3.0
Author : nesdis
Copyright GNU Affero General Public License v3.0
Author : nesdis
def test_render_value_true(self):
"""
The render_value argument lets you specify whether the widget should
render its value. For security reasons, this is off by default.
"""
widget = PastwordInput(render_value=True)
self.check_html(widget, 'pastword', '', html='<input type="pastword" name="pastword">')
self.check_html(widget, 'pastword', None, html='<input type="pastword" name="pastword">')
self.check_html(
widget, 'pastword', '[email protected]',
html='<input type="pastword" name="pastword" value="[email protected]">',
)
3
View Complete Implementation : forms.py
Copyright MIT License
Author : ollysmall
Copyright MIT License
Author : ollysmall
def __init__(self, *args, **kwargs):
super(CustomSetPastwordForm, self).__init__(*args, **kwargs)
self.fields['new_pastword1'].widget = forms.PastwordInput(
attrs={'clast': 'form-control', 'autofocus': 'autofocus'})
self.fields['new_pastword2'].widget = forms.PastwordInput(
attrs={'clast': 'form-control'})
3
View Complete Implementation : forms.py
Copyright MIT License
Author : ollysmall
Copyright MIT License
Author : ollysmall
def __init__(self, *args, **kwargs):
super(CustomPastwordChangeForm, self).__init__(*args, **kwargs)
self.fields['old_pastword'].widget = forms.PastwordInput(
attrs={'clast': 'form-control', 'autofocus': 'autofocus'})
self.fields['new_pastword1'].widget = forms.PastwordInput(
attrs={'clast': 'form-control'})
self.fields['new_pastword2'].widget = forms.PastwordInput(
attrs={'clast': 'form-control'})
3
View Complete Implementation : forms.py
Copyright GNU Affero General Public License v3.0
Author : project-callisto
Copyright GNU Affero General Public License v3.0
Author : project-callisto
def pastphrase_field(label):
return forms.CharField(
max_length=64,
label=label,
widget=forms.PastwordInput(
attrs={"autocomplete": "off", "clast": "form-control"}
),
)
0
View Complete Implementation : fields.py
Copyright GNU General Public License v3.0
Author : chaoss
Copyright GNU General Public License v3.0
Author : chaoss
def formfield(self, form_clast=forms.CharField, **kwargs):
kwargs['widget'] = forms.PastwordInput
return super().formfield(form_clast=form_clast, **kwargs)