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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file drf-translated-0.0.1.tar.gz.

File metadata

  • Download URL: drf-translated-0.0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for drf-translated-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f3c468ef20cff7f2c81d2650322f14b0cfed444b84c41a60246cf11bdd3c0e72
MD5 813f9f867a83adc6c6c36f91488565df
BLAKE2b-256 6c080c4715f6abb1be178d7d9554f037f7c0b3f5bcad9e1e1b8595aedd58b4e8

See more details on using hashes here.

File details

Details for the file drf_translated-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for drf_translated-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef6c9fa3ac2ce50852840d30d0081f25b44d8928ac50ac2edd38384099d027c1
MD5 6be6e5b16357d9999378b32cc9200489
BLAKE2b-256 b447be52de2888c74af8083647d0f053c16917264b508e343cc54152cfea3230

See more details on using hashes here.

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