예제 #1
0
    def render(self, name, value, attrs=None):
        """ Dump the python object to JSON if it hasn't been done yet. """
        from djangae.fields.json import dumps

        if not isinstance(value, six.string_types):
            value = dumps(value)
        return super(JSONWidget, self).render(name, value, attrs)
예제 #2
0
 def render(self, name, value, attrs=None):
     """ Dump the python object to JSON if it hasn't been done yet. """
     from djangae.fields.json import dumps
     if not isinstance(value, six.string_types):
         value = dumps(value)
     return super(JSONWidget, self).render(name, value, attrs)