Hello, I'm having a hard time understanding why Django won't let me serialize a dictionary of form errors. Can anyone explain why Django throws an error if I try to serialize someform.errors, even if I copy it into a plain dictionary?
#!/usr/bin/env python from django.utils import simplejson from project.main.models import SampleForm test = {} simplejson.dumps(test) # works test = {'key': [u"value"]} simplejson.dumps(test) # works # suppose SampleForms wants a text and url field # I just give it a text field to test form = SampleForm({"text": "sample text"}) d = {} # make a new dictionary # update d so we're working with a plain dictionary d.update(f.errors) type(d) # returns dict # fails: <django.utils.functional.__proxy__ object at 0x00C83810> # is not JSON serializable simplejson.dumps(d) --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---