Changes between Initial Version and Version 1 of Ticket #27562
- Timestamp:
- Dec 1, 2016, 8:50:07 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27562 – Description
initial v1 1 I am using uuid as the primary key for my CustomerUser modelwhich is to override the default django user. I got an AttributeError when trying to run `./manage.py createsuperuser`1 I am using '''uuid as the primary key''' for my ''CustomerUser model'' which is to override the default django user. I got an AttributeError when trying to run `./manage.py createsuperuser` 2 2 3 3 Here is my model. 4 ` 4 {{{ 5 5 class CustomUser(AbstractUser): 6 6 id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) 7 7 user_type = models.CharField(max_length=1, choices=TYPE_USER, default='U') 8 8 is_deleted = models.BooleanField(_('deleted'), default=False) 9 ` 9 }}} 10 10 Software version: django version 1.10.2 and python version 2.7.10 11 11 12 12 And this is the exception 13 13 14 ` 14 {{{ 15 15 value = uuid.UUID(value) 16 16 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/uuid.py", line 131, in __init__ 17 17 hex = hex.replace('urn:', '').replace('uuid:', '') 18 18 AttributeError: 'long' object has no attribute 'replace' 19 ` 19 }}}