def render(self, name, value, attrs=None):
        if value:
            # a DictionaryField (model field) returns a string value via
            # value_from_object(), load and re-dump for indentation
            try:
                value = json.dumps(json.loads(value), sort_keys=True, indent=2)
            except __HOLE__:
                # Skip formatting if value is not valid JSON
                pass
        return super(JsonMixin, self).render(name, value, attrs)
dataset/ETHPy150Open djangonauts/djorm-ext-hstore/djorm_hstore/forms.py/DictionaryFieldWidget.render