Skip to content Skip to sidebar Skip to footer

Object Has No Attribute 'object_list'

I am getting an error and I think it may be for the same reasons Viktor had a problem ('ProductList' object has no attribute 'object_list') On Viktors post AKS wrote - You might be

Solution 1:

What is the exact issue are you trying to solve or what exactly are you trying to solve through the code?

Do you want to set a context object name or do you want to retrieve data from the Product model?

If retrieve data from Product model, you can just use the objects.filter.

If this line : context = super(ProductListView, self).get_context_data(*args, **kwargs) is the issue you are trying to solve.. try moving the def get_context_data to be within the ProductListView class.

Post a Comment for "Object Has No Attribute 'object_list'"