Code

Ticket #3409: widgets.diff

File widgets.diff, 576 bytes (added by scott@…, 7 years ago)

widgets.py with PrivatePasswordInput

Line 
1Index: django/newforms/widgets.py
2===================================================================
3--- django/newforms/widgets.py  (revision 4454)
4+++ django/newforms/widgets.py  (working copy)
5@@ -81,6 +81,11 @@
6 class PasswordInput(Input):
7     input_type = 'password'
8 
9+class PrivatePasswordInput(PasswordInput):
10+    "A Password widget that does not output its value"
11+    def render(self, name, value, attrs=None):
12+        return super(PrivatePasswordInput, self).render(name, None, attrs)
13+
14 class HiddenInput(Input):
15     input_type = 'hidden'
16     is_hidden = True