gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
This commit is contained in:
2
core/http/translation/__init__.py
Normal file
2
core/http/translation/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from .core import * # noqa
|
||||
from .another import * # noqa
|
||||
16
core/http/translation/another.py
Normal file
16
core/http/translation/another.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
Django model translation resources
|
||||
"""
|
||||
|
||||
from modeltranslation import translator
|
||||
|
||||
|
||||
class PostTranslationOption(translator.TranslationOptions):
|
||||
fields = (
|
||||
"title",
|
||||
"desc",
|
||||
)
|
||||
|
||||
|
||||
class FrontendTranslationOption(translator.TranslationOptions):
|
||||
fields = ("value",)
|
||||
14
core/http/translation/core.py
Normal file
14
core/http/translation/core.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
Register models
|
||||
"""
|
||||
|
||||
from modeltranslation.translator import translator
|
||||
|
||||
from core.http import models
|
||||
from core.http.translation import another
|
||||
|
||||
|
||||
translator.register(models.Post, another.PostTranslationOption)
|
||||
translator.register(
|
||||
models.FrontendTranslation, another.FrontendTranslationOption
|
||||
) # noqa
|
||||
Reference in New Issue
Block a user