#27562: Django using uuid as primary key, receive AttributeError during
               Reporter:  diansheng      |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  Uncategorized  |        Version:  1.10
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
 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`

 Here is my model.
 class CustomUser(AbstractUser):
     id = models.UUIDField(primary_key=True, default=uuid.uuid4,
     user_type = models.CharField(max_length=1, choices=TYPE_USER,
     is_deleted = models.BooleanField(_('deleted'), default=False)
 Software version: django version 1.10.2 and python version 2.7.10

 And this is the exception

 value = uuid.UUID(value)
 line 131, in __init__
     hex = hex.replace('urn:', '').replace('uuid:', '')
 AttributeError: 'long' object has no attribute 'replace'

Ticket URL: <https://code.djangoproject.com/ticket/27562>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to