I'm sorting a dictionary like this:
{% for s in selected.values() | sort(attribute="last_name") | sort(attribute="first_name") | sort(attribute="middle_initial") %}
But sometimes the input dictionary doesn't contain last_name
, how could I go about sorting the dictionary in the event the key isn't present? I'd like to use a default value similar to how you would access a dictionary in Python3 as such:
selected.get('last_name', 'Unknown')