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

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * needs_tests:   => 0


Old description:

> A model with a UUID as its primary key. Running `dumpdata` management
> command with JSON output format (the default option) resulted in the
> following error
>
> {{{
> CommandError: Unable to serialize database: UUID('435697b4-954a-4b9a-
> a83a-2b53016b0d43') is not JSON serializable
> }}}
>
> However running again with `--format=xml` did not result in an error and
> `dumpdata` was successful.

New description:

 A model using a UUIDField as its primary key. Running `dumpdata`
 management command with JSON output format (the default option) resulted
 in the following error

 {{{
 CommandError: Unable to serialize database: UUID('435697b4-954a-4b9a-a83a-
 2b53016b0d43') is not JSON serializable
 }}}

 However running again with `--format=xml` did not result in an error and
 `dumpdata` was successful.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/24320#comment:1>
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.759c56529705e780b0d098119d62ca6b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to