Skip to main content

DRF modeltranslation serializer

Project description

drf-translated

django-modeltranslation DRF serializers

Features

  • Query/context translation support
  • Highly customizable

Installation

pip install drf-translated

Usage

Create a drf_translated.serializers.TranslatedModelSerializer serializer for your registered translation model:

from drf_translated.serializers import TranslatedModelSerializer

class MovieSerializer(TranslatedModelSerializer):
  class Meta:
    model = Movie

    fields = '__all__'
Setting Default Description
DRF_TRANSLATED_QUERY_PARAM language Query language param to convert translated values from dict to str
DRF_TRANSLATED_LOCALE_CONTEXT locale Serializer context key for getting translation language

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drf-translated-0.0.1.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

drf_translated-0.0.1-py3-none-any.whl (2.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page