Answer the question
In order to leave comments, you need to log in
How to properly send django notifications?
There is the following category model:
class Category(MPTTModel, models.Model):
is_active = models.BooleanField(
verbose_name='Активно', default=True)
parent = TreeForeignKey(
'self', verbose_name='Родительская категория', related_name='childs',
on_delete=models.CASCADE, blank=True, null=True)
title = models.CharField(
verbose_name='Название', max_length=1024)
slug = models.SlugField(
verbose_name='Слаг', max_length=1024)
def save(self, *args, **kwargs):
if self._state.adding:
>>> CODE
super(Category, self).save(*args, **kwargs)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question