Changes between Initial Version and Version 1 of Ticket #19354
- Timestamp:
- Nov 24, 2012, 9:10:23 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #19354 – Description
initial v1 2 2 I've written a custom user model, and wished to set a field as the primary key. See the example below. 3 3 4 {{{ 4 5 class User(AbstractBaseUser): 5 6 email = models.EmailField(_('email'), max_length=75, unique=True, primary_key=True) … … 7 8 USERNAME_FIELD = 'email' 8 9 ... 9 10 }}} 10 11 Registering the user works fine, but when I authenticate the user using django.contrib.auth.views.login, I get an error stating that the 'User' object has no attribute 'id'. 11 12 … … 15 16 16 17 Here's a summary of the error report: 18 {{{ 17 19 Exception Type: AttributeError 18 20 Exception Value: 'User' object has no attribute 'id' … … 20 22 Python Executable: <path>/bin/python 21 23 Python Version: 2.6.5 24 }}} 22 25 23 26 Regards,