Skip to content

Create Metaclass to translate Model fields

Closes #35 (closed)

Dit ondersteunt nu dingen als:

from django.db import models
from utils.translation import MultilingualField, ModelTranslateMeta


class MerchandiseItem(models.Model, metaclass=ModelTranslateMeta):

    description = MultilingualField(models.TextField, default='', verbose_name='Some elaborate text')

In je templates kan je gewoon transparant bijv. merchandise_item.description blijven gebruiken.

Merge request reports