bt.py 427 Bytes
Newer Older
1
2
3
4
from django.template import Library, Variable
from django.conf import settings
from django import template
import random
stef's avatar
stef committed
5
from nnmon.bt.models import COUNTRIES
6
7
8
9
10
11
12
13
14
15
16

register = Library()

@register.simple_tag
def root_url():
    return settings.ROOT_URL

@register.simple_tag
def media_url():
    return settings.MEDIA_URL

stef's avatar
stef committed
17
18
19
20
country_map=dict(COUNTRIES)
@register.filter(name='country')
def country(code):
    return country_map[code]