2👍
✅
'extra_content':{'item_list':Item.objects.all()}
will be evaluated when the URLconf is loaded, so item_list
will contain the same items for every request. Using a lambda tells Django to call that lambda for every request, meaning that items_list
will change as new Items
are added, removed, or edited in the database.
Source:stackexchange.com