#2727: [patch] is not JSON serializable
---------------------------------+------------------------------------------
          Reporter:  msamoylov   |         Owner:  adrian
            Status:  closed      |     Milestone:        
         Component:  Validators  |       Version:  SVN   
        Resolution:  fixed       |      Keywords:        
             Stage:  Unreviewed  |     Has_patch:  1     
        Needs_docs:  0           |   Needs_tests:  0     
Needs_better_patch:  0           |  
---------------------------------+------------------------------------------
Comment (by sunrise):

 Seems like it's not... Generally simplejson works with byte strings but
 just outputs garbage (and may be this is locale related so may be if
 locale is equal to DEFAULT_CHARSET all will be fine). The issue with
 gettext_lazy (as I understand) is that simplejson sees this as a function,
 not a string, and refuses to serialize it. Replacing it with gettext makes
 actual translation of error message immediately so by the time when
 serialization is being made there is a plain string
 already.[http://www.tagnice.com  nike air yeezy]

 AFAIK, a lazy version of gettext is only necessary when translating
 strings in models since by the time of import of a model you don't have a
 web environment yet and thus cannot know a user's preferred language. But
 validation works in view code so there's no such problem.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/2727#comment:16>
Django <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to