March 2020
Intermediate to advanced
608 pages
17h 17m
English
Follow these practices when working with models that use models from other apps:
# myproject/apps/ideas/models.pyfrom django.db import modelsfrom django.conf import settingsfrom django.utils.translation import gettext_lazy as _class Idea(models.Model): author = models.ForeignKey( settings.AUTH_USER_MODEL, verbose_name=_("Author"), on_delete=models.SET_NULL, blank=True, null=True, ) category = models.ForeignKey( "categories.Category", verbose_name=_("Category"), blank=True, null=True, on_delete ...