Skip to content

Instantly share code, notes, and snippets.

View Northshoot's full-sized avatar

Laurynas Riliskis Northshoot

  • San Francisco, CA, USA
  • 14:47 (UTC -07:00)
View GitHub Profile
@Northshoot
Northshoot / JsonPropertySerializer.py
Created July 1, 2017 13:56
This is a small class that i wrote that extends the functionality of the JsonSerializer from django.Why i wrote this??Two majors points: 1. I need to serialize @Property parameters for my grid builded using jQuery 2. To get the label of choices values and to serialize that values not the flags as the default django serialize do; - Exemplo [( "TI…
# -*- coding: utf-8 -*-
import warnings
from django.core.serializers.json import Serializer
from django.utils.encoding import smart_text, is_protected_type
from django.utils import six
from django.utils.html import escape
import json