I would like to make a dictionary in the dictionary.
I have this code
dictionary = {}
for g in genre:
total = 0
products = Product.objects.filter(genre=g)
for product in products:
total += product.popularity
dictionary[g.category] = {g.name: total}
I would like it to look like this, for example
{'book': {'Horror':0, 'Comedy:0}, 'cd': {'Disco': 0, 'Rap': 0}}