def choicify(dictionary):
<EOL>ordered_fields = sorted(dictionary, key=dictionary.get)<EOL>choices = []<EOL>for field in ordered_fields:<EOL><INDENT>row = (dictionary[field], _(field.replace('<STR_LIT:_>', '<STR_LIT:U+0020>')))<EOL>choices.append(row)<EOL><DEDENT>return choices<EOL>
Converts a readable python dictionary into a django model/form
choice structure (list of tuples) ordered based on the values of each key

:param dictionary: the dictionary to convert