diff --git a/feedback/migrations/0005_feedback_category.py b/feedback/migrations/0005_feedback_category.py new file mode 100644 index 00000000..9864f758 --- /dev/null +++ b/feedback/migrations/0005_feedback_category.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.9 on 2024-09-19 19:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("feedback", "0004_contentcurationrequest_created_at_and_more"), + ] + + operations = [ + migrations.AddField( + model_name="feedback", + name="category", + field=models.TextField(blank=True, default=""), + ), + ] diff --git a/feedback/models.py b/feedback/models.py index de2921b5..feb8d661 100644 --- a/feedback/models.py +++ b/feedback/models.py @@ -8,6 +8,7 @@ class Feedback(models.Model): name = models.CharField(max_length=150) email = models.EmailField() subject = models.CharField(max_length=400) + category = models.TextField(default="", blank=True) comments = models.TextField() source = models.CharField(max_length=50, default="SDE", blank=True) created_at = models.DateTimeField(null=True, blank=True) @@ -37,6 +38,7 @@ def format_notification_message(self): f"Name: {self.name}\n" f"Email: {self.email}\n" f"Subject: {self.subject}\n" + f"Feedback Category: {self.category}\n" f"Comments: {self.comments}\n" f"Source: {self.source}\n" f"Received on: {self.created_at.strftime('%Y-%m-%d %H:%M:%S')}" diff --git a/feedback/serializers.py b/feedback/serializers.py index 6956e16f..8769e37d 100644 --- a/feedback/serializers.py +++ b/feedback/serializers.py @@ -10,6 +10,7 @@ class Meta: "name", "email", "subject", + "category", "comments", "source", "created_at",