Source

django-pim / sitetracker / templatetags / server_list.py

from django import template
from sitetracker.models import HostingProvider, Domain

register = template.Library()

@register.inclusion_tag('sitetracker/server_list.html')
def server_list(srv=None):
    providers = HostingProvider.objects.all()
    return {'provider_list':providers, 'current':srv}

@register.inclusion_tag('sitetracker/admin_list.html')
def admin_list():
    domains = Domain.objects.all()
    return {'domain_list':domains}