The issue is that you are using the same variable name for the item returned from the products list.
for products in self.products:
So you now have a local variable called
which is the first item in your
list. Assuming it is a string it does not have an attribute named
. Your code is somewhat confusing as it is not clear what items you have in the list.