on-internet
← Community

Filter list of dictionaries

Stack Overflow ·

This is my example: dictlist = [{'first': 'James', 'last': 'Joule'}, {'first': 'James','last': 'Watt'}, {'first': 'Christian','last': 'Doppler'}] I am trying to get the last name. If this was in a model, the code would be: getdata = Name.objects.filter(name="Christian") getLastName = getdata.last and I would get "Doppler".

Comments

Sign in or sign up to comment and upvote.

No comments yet.