Код: Выделить всё
class Interest(TimestampedModel):
subjects = models.ManyToManyField('genre.Subject', blank=True)
def save(self, *args, **kwargs):
if self.id:
old_subjects = Interest.objects.filter(pk=self.pk).first().subjects.all()
subjects = self.subjects.all()
if subjects != old_subjects:
# Do stuff
Подробнее здесь: https://stackoverflow.com/questions/692 ... as-changed
Мобильная версия