def sort_pack_entry(entry):
    """Sort the entry of a pack so that fields are in this order:
    orig, text, quality, note, anythingelse(including partial)
    """

    order = {"orig":-4, "text":-3, "quality":-2, "note":-1}
    return dict(sorted(entry.items(), key=lambda kv: order.get(kv[0], 0)))