Post the full error message and/or traceback reported by the server when the error occurs.
-James
On Thu, Aug 22, 2019, 12:31 PM Catalina Popescu <catalina.t.popescu@gmail.com> wrote:
--views.pyclass BookDisplay(DetailView):model = Booktemplate_name = 'books/book_detail.html'def get_context_data(self, **kwargs):context = super().get_context_data(**kwargs)context['form'] = WishBookForm()return contextclass WishBook(SingleObjectMixin, FormView):form_class = WishBookForm()template_name = 'books/book_detail.html'model = Statusdef post(self, request):if not request.user.is_authenticated:return HttpResponseForbidden()self.object = self.get_object()return super().post(request)def get_success_url(self):return reverse('books/book_detail', kwargs = {'pk': self.object.pk})class BookDetail(View):def get(self, request):view = BookDisplay.as_view()return view(request)def post(self, request):view = WishBook.as_view()return view(request)forms.pyclass WishBookForm(forms.Form):status = forms.ChoiceField(choices=Status.GIVEAWAY_STATUS[:2], initial='Cu chef de ducă')
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/231fd7dc-3bf2-465c-993b-c476b0ca4dc1%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciX1baRiKGuYZZcjdMeDyPpicaiqk9aP2fyLMnQEBFQdDw%40mail.gmail.com.
No comments:
Post a Comment