#24320: Unable to serialize UUIDField when running dumpdata with JSON format
-------------------------------------+-------------------------------------
     Reporter:  jamesbeith           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core                 |                  Version:  1.8alpha1
  (Serialization)                    |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by timgraham):

 I created a custom user with UUID pk:
 {{{
 import uuid

 from django.contrib.auth.models import AbstractUser
 from django.db import models


 class UUIDUser(AbstractUser):
     id = models.UUIDField(primary_key=True, default=uuid.uuid4)
 }}}
 And then tried:
 {{{
 python manage.py dumpdata uuiduser.UUIDUser
 [{"fields": {"username": "tim", "first_name": "", "last_name": "",
 "is_active": true,
 "is_superuser": true, "is_staff": true, "last_login":
 "2015-02-11T19:01:02.747Z",
 "groups": [], "user_permissions": [], "password": "...", "email":
 "[email protected]",
 "date_joined": "2015-02-11T18:55:33.572Z"}, "model": "uuiduser.uuiduser",
 "pk": "dd100fcd-a894-4435-ad30-bdcd4671ac44"}]
 }}}
 Tested on SQLite and PostgreSQL. Could you provide more details? I'm also
 attached a test for Django's test suite that I tried writing to reproduce
 the issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/24320#comment:3>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.7495b7f7fb2db29e70f47de27914c544%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to