Mercurial > hg > agora
view apps/treecomments/forms.py @ 213:6f285552a9d0 default tip
Remove requirement to be logged in to see comments
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Thu, 16 Jan 2014 10:59:05 -0500 (2014-01-16) |
parents | 134f726fd62c |
children |
line wrap: on
line source
from django import forms from django.contrib.admin import widgets from django.contrib.comments.forms import CommentForm from apps.treecomments.models import TreeComments class TreeCommentsForm(CommentForm): parent = forms.ModelChoiceField(queryset=TreeComments.objects.all(), required=False, widget=forms.HiddenInput) def get_comment_model(self): return TreeComments def get_comment_create_data(self): data = super(TreeCommentsForm,self).get_comment_create_data() data['parent'] = self.cleaned_data['parent'] return data