I've been doing Python web apps for a few years. All of them have involved some pattern of declaring runtime vars to represent DB values, and also mapping those DB values to user-facing display values in your view templates. The practice of keeping the { var --> value } and { value --> display string } maps separately led to annoying dev-time bugs. Here's my short and easy solution.<p>MIT License. Enjoy.
Does nobody else find the repetition objectionable?
e.g. NEW = ('N', 'New'),
If your values have good names, you can easily deduce "Some Constant" from SOME_CONSTANT or vice-versa. While I'm at it, having abbreviations built-in seems iffy too.