Ticket #5786: 5786.django.contrib.auth.diff
File 5786.django.contrib.auth.diff, 3.3 KB (added by , 17 years ago) |
---|
-
django/contrib/auth/tests.py
35 35 [] 36 36 >>> a.user_permissions.all() 37 37 [] 38 """ 38 39 >>> u3 = User.objects.create_user('testuser3@example.com', 'test3@example.com', 'test3') 40 >>> u3.username = 'testuser3a@example.com' 41 >>> u3.save() 42 """ -
django/contrib/auth/models.py
128 128 129 129 Username and password are required. Other fields are optional. 130 130 """ 131 username = models.CharField(_('username'), max_length=30, unique=True, validator_list=[validators.isAlphaNumeric], help_text=_("Required. 30 characters or fewer. Alphanumeric characters only (letters, digits and underscores)."))131 username = models.CharField(_('username'), max_length=30, unique=True, help_text=_("Required. 30 characters or fewer.")) 132 132 first_name = models.CharField(_('first name'), max_length=30, blank=True) 133 133 last_name = models.CharField(_('last name'), max_length=30, blank=True) 134 134 email = models.EmailField(_('e-mail address'), blank=True) -
django/contrib/auth/forms.py
11 11 def __init__(self): 12 12 self.fields = ( 13 13 oldforms.TextField(field_name='username', length=30, max_length=30, is_required=True, 14 validator_list=[ validators.isAlphaNumeric,self.isValidUsername]),14 validator_list=[self.isValidUsername]), 15 15 oldforms.PasswordField(field_name='password1', length=30, max_length=60, is_required=True), 16 16 oldforms.PasswordField(field_name='password2', length=30, max_length=60, is_required=True, 17 17 validator_list=[validators.AlwaysMatchesOtherField('password1', _("The two password fields didn't match."))]), -
tests/regressiontests/auth_backends/tests.py
69 69 True 70 70 >>> user.has_perms(['auth.test3', 'auth.test_group']) 71 71 True 72 73 >>> user = User.objects.create_user('test2@example.com', 'test2@example.com', 'test') 74 >>> user = User.objects.get(username="test2@example.com") 75 >>> user.username 76 u'test2@example.com' 77 >>> user.username = 'test2a@example.com' 78 >>> user.save() 72 79 """} -
docs/authentication.txt
56 56 57 57 ``User`` objects have the following fields: 58 58 59 * ``username`` -- Required. 30 characters or fewer. Alphanumeric characters60 only (letters, digits and underscores).59 * ``username`` -- Required. 30 characters or fewer. May contain any 60 character. 61 61 * ``first_name`` -- Optional. 30 characters or fewer. 62 62 * ``last_name`` -- Optional. 30 characters or fewer. 63 63 * ``email`` -- Optional. E-mail address.