On Thu, Apr 2, 2009 at 5:49 AM, Adam Nelson <a...@varud.com> wrote: > How do I do a fixture for the Site model? I've tried all sorts of different > model names > [ > { > "model": "sites.site", > "pk": 1, > "fields": { > "domain": "example.com", > "name": "Example" > } > }, > ] > And I get this error: > ... > File > "/Library/Python/2.5/site-packages/django/utils/simplejson/decoder.py", line > 221, in JSONArray > raise ValueError(errmsg("Expecting object", s, end)) > ValueError: Expecting object: line 10 column 1 (char 124) > Any ideas for the correct model name? I've tried every possibility I can > think of.
Unlike Python, JSON is very fussy about commas. In particular, Python allows redundant commas in lists (i.e., [1,2,3,] - the comma after the 3), but JSON doesn't. The problem here is the comma on the second last line. That comma leads SimpleJSON to believe that line 10 should start a new element in the list, but instead, the list is ended. Hence, line 10, column 1 reports an error. Delete the comma and you'll be fine. Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---