Changes between Initial Version and Version 1 of Ticket #27562


Ignore:
Timestamp:
Dec 1, 2016, 8:50:07 PM (8 years ago)
Author:
Sean, Liu Diansheng
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27562 – Description

    initial v1  
    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`
     1I 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`
    22
    33Here is my model.
    4 `
     4{{{
    55class CustomUser(AbstractUser):
    66    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    77    user_type = models.CharField(max_length=1, choices=TYPE_USER, default='U')
    88    is_deleted = models.BooleanField(_('deleted'), default=False)
    9 `
     9}}}
    1010Software version: django version 1.10.2 and python version 2.7.10
    1111
    1212And this is the exception
    1313
    14 `
     14{{{
    1515value = uuid.UUID(value)
    1616  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/uuid.py", line 131, in __init__
    1717    hex = hex.replace('urn:', '').replace('uuid:', '')
    1818AttributeError: 'long' object has no attribute 'replace'
    19 `
     19}}}
Back to Top