March 2020
Intermediate to advanced
608 pages
17h 17m
English
Let's suppose that you have the Idea model, with a foreign key pointing to the Category model.
# myproject/apps/categories/models.pyfrom django.db import modelsfrom django.utils.translation import gettext_lazy as _from myproject.apps.core.model_fields import MultilingualCharFieldclass Category(models.Model): title = MultilingualCharField( _("Title"), max_length=200, ) class Meta: verbose_name = _("Category") verbose_name_plural = _("Categories") def __str__(self): return self.title
# myproject/apps/ideas/models.pyfrom django.db import modelsfrom django.conf import settingsfrom django.utils.translation ...