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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for drf_translated-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef6c9fa3ac2ce50852840d30d0081f25b44d8928ac50ac2edd38384099d027c1 |
|
MD5 | 6be6e5b16357d9999378b32cc9200489 |
|
BLAKE2b-256 | b447be52de2888c74af8083647d0f053c16917264b508e343cc54152cfea3230 |