mirror of https://github.com/interlegis/sigi.git
Sesóstris Vieira
1 year ago
1 changed files with 14 additions and 0 deletions
@ -0,0 +1,14 @@ |
|||
from django import template |
|||
from django.conf import settings |
|||
from django.templatetags.static import static |
|||
|
|||
register = template.Library() |
|||
|
|||
|
|||
@register.filter |
|||
def get(d, key_name): |
|||
try: |
|||
value = d[key_name] |
|||
except KeyError: |
|||
value = settings.TEMPLATE_STRING_IF_INVALID |
|||
return value |
Loading…
Reference in new issue