class ProductDetailSlugview(ObjectViewedMixin, DetailView):
queryset = Product.objects.all()
template_name = "products/product_detail.html"
def get_context_data(self, *args, **kwargs):
context=super(ProductDetailSlugview, self).get_context_data(*args , **kwargs)
cart_object, new_object = Cart.objects.new_or_get(self.request)
context['cart']=cart_object
return context
this is my view
ValueError at /product/list/blackberry Cannot assign
" at 0x7f0488733860>>": "ObjectViewed.user" must be a "User" instance.
Request Method: GET Request
URL: http://127.0.0.1:8000/product/list/blackberry Django
Version: 2.1.3 Exception Type: ValueError Exception Value: Cannot
assign " object at 0x7f0488733860>>": "ObjectViewed.user" must be a "User"
instance. Exception
Location: /home/wiwigi/Desktop/django-virtual/lib/python3.6/site-packages/django/db/models/fields/related_descriptors.py
in set, line 210 Python
Executable: /home/wiwigi/Desktop/django-virtual/bin/python3 Python
Version: 3.6.5 Python Path: ['/home/wiwigi/Desktop/ecommerce_sample',
'/home/wiwigi/Desktop/ecommerce_sample',
'/home/wiwigi/Desktop/django-virtual/lib/python36.zip',
'/home/wiwigi/Desktop/django-virtual/lib/python3.6',
'/home/wiwigi/Desktop/django-virtual/lib/python3.6/lib-dynload',
'/usr/lib/python3.6',
'/home/wiwigi/Desktop/django-virtual/lib/python3.6/site-packages',
'/home/wiwigi/pycharm-2018.1.2/helpers/pycharm_matplotlib_backend']
Server time: mar, 26 Fév 2019 11:31:14 +0000
and my error code please help me