Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pdn import constants
- @register.simple_tag
- def get_constant(constant, value, constant_type="CHOICES_DICT"):
- try:
- return getattr(getattr(constants, constant), constant_type)[int(value)]
- except AttributeError:
- return "NC"
Add Comment
Please, Sign In to add comment