From 5b95f099497d1269c255a4dc66505d2b64bcf4d8 Mon Sep 17 00:00:00 2001 From: Ivlev Denis Date: Mon, 12 Mar 2018 13:06:43 +0300 Subject: [PATCH] LIL-33. Add DeactivatedMixin to Comment model --- .../migrations/0035_comment_deactivated_at.py | 18 ++++++++++++++++++ apps/course/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 apps/course/migrations/0035_comment_deactivated_at.py diff --git a/apps/course/migrations/0035_comment_deactivated_at.py b/apps/course/migrations/0035_comment_deactivated_at.py new file mode 100644 index 00000000..cd5ba08e --- /dev/null +++ b/apps/course/migrations/0035_comment_deactivated_at.py @@ -0,0 +1,18 @@ +# Generated by Django 2.0.2 on 2018-03-12 10:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('course', '0034_auto_20180215_1503'), + ] + + operations = [ + migrations.AddField( + model_name='comment', + name='deactivated_at', + field=models.DateTimeField(blank=True, default=None, null=True), + ), + ] diff --git a/apps/course/models.py b/apps/course/models.py index ad59b1b1..98a64423 100644 --- a/apps/course/models.py +++ b/apps/course/models.py @@ -196,7 +196,7 @@ class Material(models.Model): ordering = ('title',) -class Comment(PolymorphicMPTTModel): +class Comment(PolymorphicMPTTModel, DeactivatedMixin): content = models.TextField('Текст комментария', default='') author = models.ForeignKey(User, on_delete=models.CASCADE) parent = PolymorphicTreeForeignKey(