Skip to content

Instantly share code, notes, and snippets.

@vdboor
vdboor / fields.py
Last active February 18, 2016 09:46
USE https://github.com/edoburu/django-parler-rest/ NOW! THIS GIST IS DEPRECATED. It was a test to share code before making the package ----- Combining django-parler with django-rest-framework. Please tell me how that code is working for you, and if you have any improvements. The final version could be included into a 'contrib' folder of django-p…
from django.core.exceptions import ImproperlyConfigured
from rest_framework import serializers
from rest_framework.serializers import SortedDictWithMetadata
from .utils import create_translated_fields_serializer
class TranslatedFieldsField(serializers.WritableField):
"""
Exposing translated fields for a TranslatableModel in REST style.
"""