This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy | |
from django.http.request import QueryDict | |
from django.utils.datastructures import CaseInsensitiveMapping | |
from rest_framework.serializers import empty | |
class CaseInsensitiveSerializer(serializers.Serializer): | |
""" | |
Serializer which treats parameters names as case-sensitive. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from PIL import Image | |
class CachedPilLoader: | |
def __init__(self): | |
self.cache = {} | |
def __call__(self, path): | |
if path not in self.cache: | |
with open(path, 'rb') as f: |