﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25794	loaddata with UUIDs as natural foreign keys does not work anymore	Gunnar Scherf	nobody	"When I run dumpdata with a model which has a UUIDField as a natural key, the dump can not be loaded anymore.
{{{
manage.py dumpdata --natural-foreign  myapp
manage.py loaddata  myapp
}}}

The model :
{{{#!python
class ApplicationManager(models.Manager):
    def get_by_natural_key(self, uuid):
        return self.get(uuid=uuid)

class Application(models.Model):
    uuid = models.UUIDField(unique=True, default=uuid.uuid4, editable=True)
    ...
}}}
 
The dump looks like this
{{{
[
{
  ""model"": ""accounts.applicationrole"",
  ""fields"": {
    ""application"": [
      ""ec1e39cb-e3e7-46c7-87b7-70ace4165d13""
    ],
    ...
}}}
The error message in loaddata is:
{{{ 
'(UUID('ec1e39cb-e3e7-46c7-87b7-70ace4165d13'),)' is not a valid UUID.
}}}

"	Bug	closed	Core (Management commands)	1.9rc1	Normal	invalid	UUID loaddata --natural-foreign		Unreviewed	0	0	0	0	0	0
