From 5d8b002b48da791b090314a2df3e500734b5b62f Mon Sep 17 00:00:00 2001 From: pnshiralkar Date: Mon, 18 May 2020 20:51:47 +0530 Subject: Renamed model WorkshopComments to Comments and added hidden tag to the non-public comments --- workshop_app/forms.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'workshop_app/forms.py') diff --git a/workshop_app/forms.py b/workshop_app/forms.py index 6099a76..95b0ce1 100644 --- a/workshop_app/forms.py +++ b/workshop_app/forms.py @@ -3,7 +3,7 @@ from string import punctuation, digits from django import forms from django.utils import timezone -from .models import (Profile, Workshop, department_choices, title, source, states, WorkshopComment) +from .models import (Profile, Workshop, department_choices, title, source, states, Comment) try: from string import letters @@ -170,19 +170,19 @@ class WorkshopForm(forms.ModelForm): } -class WorkshopCommentsForm(forms.ModelForm): +class CommentsForm(forms.ModelForm): """ Users will post comments on workshops """ def __init__(self, *args, **kwargs): kwargs.setdefault('label_suffix', '') - super(WorkshopCommentsForm, self).__init__(*args, **kwargs) + super(CommentsForm, self).__init__(*args, **kwargs) self.fields['comment'].required = True self.fields['public'].label = "Public" class Meta: - model = WorkshopComment + model = Comment exclude = ['author', 'created_date', 'workshop'] widgets = { 'comment': forms.Textarea(attrs={ -- cgit