El 24/04/15 06:08, David escribió:
This appears to work. Using a view for 2 functions seems pretty fugly
though. Are there better ways to achieve this?
class CreateComment(ListView, FormMixin):
model = Comment
paginate_by = 2
form_class = CommentForm
def post(self, request, *args, **kwargs):
f
This appears to work. Using a view for 2 functions seems pretty fugly
though. Are there better ways to achieve this?
class CreateComment(ListView, FormMixin):
model = Comment
paginate_by = 2
form_class = CommentForm
def post(self, request, *args, **kwargs):
form = CommentForm(self.request.POST)
Hi
I am using the following:
class CreateComment(ListView):
model = Comment
paginate_by = 2
form_class = CommentForm
def post(self, request, *args, **kwargs):
if not request.user.is_authenticated():
return HttpResponseForbidden()
self.object = self.get_object()
self.object.creator = request.use
3 matches
Mail list logo