I have the following structure:
structure = { 'pizza': { # other fields 'sorting': 2, }, 'burger': { # other fields 'sorting': 3, }, 'baguette': { # other fields 'sorting': 1, } }
From this structure, I need the keys of the external dictionary sorted by the sorting field of the internal dictionary, so the output is ['baguette', 'pizza', 'burger'] .
Is there a simple enough way to do this?
source share