From 8d8c559778e76ce7ae59ae69631f2ddf0fdc2653 Mon Sep 17 00:00:00 2001 From: Gokuldevx Date: Fri, 22 Aug 2025 06:56:42 +0530 Subject: [PATCH] added commentform --- civicfix/core/forms.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/civicfix/core/forms.py b/civicfix/core/forms.py index 77787de..49c5aee 100644 --- a/civicfix/core/forms.py +++ b/civicfix/core/forms.py @@ -1,6 +1,6 @@ from django import forms from django.contrib.auth.forms import UserCreationForm -from .models import User, Issue +from .models import User, Issue, Comment class CitizenRegistrationForm(UserCreationForm): email = forms.EmailField(required=True) @@ -46,4 +46,12 @@ class IssueForm(forms.ModelForm): 'latitude': forms.HiddenInput(), 'longitude': forms.HiddenInput(), 'description': forms.Textarea(attrs={'rows': 4, 'placeholder': 'Describe the issue in detail...'}), - } \ No newline at end of file + } + +class CommentForm(forms.ModelForm): + class Meta: + model = Comment + fields = ["content"] + widgets = { + "content": forms.Textarea(attrs={"rows": 2, "placeholder": "Add a comment..."}) + }