What steps will reproduce the problem?
>>> from djblets.siteconfig.models import SiteConfiguration
>>> s=SiteConfiguration(site_id=1)
>>> s.set('mykey', 'myvalue')
>>> s.save()
$ ./manage.py dumpdata siteconfig --indent=2 | tee /tmp/siteconfig.json
[
{
"pk": 1,
"model": "siteconfig.siteconfiguration",
"fields": {
"version": "",
"site": 1,
"settings": "{u'mykey': u'myvalue'}"
}
}
]
$ ./manage.py loaddata /tmp/siteconfig.json
What is the expected output? What do you see instead?
Should load the fixture as expected. Spits the following traceback instead:
Installing json fixture '/tmp/siteconfig' from '/tmp/siteconfig'.
Problem installing fixture '/tmp/siteconfig.json': Traceback (most recent
call last):
File "django/core/management/commands/loaddata.py", line 150, in handle
for obj in objects:
File "django/core/serializers/json.py", line 41, in Deserializer
for obj in PythonDeserializer(simplejson.load(stream)):
File "django/core/serializers/python.py", line 96, in Deserializer
yield base.DeserializedObject(Model(**data), m2m_data)
File "djblets/siteconfig/models.py", line 54, in __init__
models.Model.__init__(self, *args, **kwargs)
File "django/db/models/base.py", line 266, in __init__
signals.post_init.send(sender=self.__class__, instance=self)
File "django/dispatch/dispatcher.py", line 148, in send
response = receiver(signal=self, sender=sender, **named)
File "djblets/util/fields.py", line 159, in post_init
value = self.loads(value)
File "djblets/util/fields.py", line 169, in loads
val = simplejson.loads(s, encoding=settings.DEFAULT_CHARSET)
File "django/utils/simplejson/__init__.py", line 343, in loads
return cls(encoding=encoding, **kw).decode(s)
File "django/utils/simplejson/decoder.py", line 326, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "django/utils/simplejson/decoder.py", line 342, in raw_decode
obj, end = self.scan_once(s, idx)
File "django/utils/simplejson/scanner.py", line 36, in _scan_once
return parse_object((string, idx + 1), encoding, strict, _scan_once,
object_hook)
File "django/utils/simplejson/decoder.py", line 153, in JSONObject
raise ValueError(errmsg("Expecting property name", s, end))
ValueError: Expecting property name: line 1 column 1 (char 1)
I trimmed source file paths in the traceback for clarity. Using XML as the
serialization format gives a similar traceback.
What operating system are you using? What browser?
Ubuntu Intrepid 8.10, Python 2.5.2, Django trunk @9825.