|
@@ -1199,23 +1199,23 @@ handle_upload = FileFormUploader()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-class MediaView(LoginRequiredMixin, TemplateView):
|
|
|
|
|
- template_name = 'marktplatz/media_overview.html'
|
|
|
|
|
-
|
|
|
|
|
- def get(self, request, pk):
|
|
|
|
|
- self.user = self.request.user
|
|
|
|
|
- user= self.user
|
|
|
|
|
- contact = Contact.objects.get(user=user)
|
|
|
|
|
- if not Product.objects.filter(contact=contact).filter(pk=pk).exists():
|
|
|
|
|
- raise Http404
|
|
|
|
|
-
|
|
|
|
|
- context = request.GET.dict()
|
|
|
|
|
- contact = Contact.objects.get(user=self.request.user)
|
|
|
|
|
- product = get_object_or_404(Product, (Q(pk = pk) & Q(contact = contact)))
|
|
|
|
|
- context['product'] = product
|
|
|
|
|
- context['media'] = Media.objects.filter(product=product)
|
|
|
|
|
- context['video'] = Video.objects.filter(product=product)
|
|
|
|
|
- return render(request, self.template_name, context)
|
|
|
|
|
|
|
+# class MediaView(LoginRequiredMixin, TemplateView):
|
|
|
|
|
+# template_name = 'marktplatz/media_overview.html'
|
|
|
|
|
+#
|
|
|
|
|
+# def get(self, request, pk):
|
|
|
|
|
+# self.user = self.request.user
|
|
|
|
|
+# user= self.user
|
|
|
|
|
+# contact = Contact.objects.get(user=user)
|
|
|
|
|
+# if not Product.objects.filter(contact=contact).filter(pk=pk).exists():
|
|
|
|
|
+# raise Http404
|
|
|
|
|
+#
|
|
|
|
|
+# context = request.GET.dict()
|
|
|
|
|
+# contact = Contact.objects.get(user=self.request.user)
|
|
|
|
|
+# product = get_object_or_404(Product, (Q(pk = pk) & Q(contact = contact)))
|
|
|
|
|
+# context['product'] = product
|
|
|
|
|
+# context['media'] = Media.objects.filter(product=product)
|
|
|
|
|
+# context['video'] = Video.objects.filter(product=product)
|
|
|
|
|
+# return render(request, self.template_name, context)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|