Files @ df07ff9dfd85
Branch filter:

Location: conntrackt/conntrackt/urls.py

branko
Changed the project widget to have a bit more style consistency. Removed link for location.
# Import basic functions for URL pattern processing.
from django.conf.urls import patterns, url

# For plain generic views
from conntrackt.models import Entity, Location
from django.views.generic import DetailView

# Import some app-specific views.
from conntrackt.views import IndexView, IptablesView, ProjectView, get_project_iptables

urlpatterns = patterns(
    'conntrackt.views',
    # Homepage/index view.
    url(r'^$', IndexView.as_view(), name="index"),
    # View for showing information about a project.
    url(r'^project/(?P<pk>\d+)/$', ProjectView.as_view(),
        name = 'project'),
    # View for showing information about an entity.
    url(r'^entity/(?P<pk>\d+)/$', DetailView.as_view(model = Entity),
        name = 'entity'),
    # View for showing information about a location.
    url(r'^location/(?P<pk>\d+)/$', DetailView.as_view(model = Location),
        name = 'location'),
    # View for rendering iptables rules for a specific entity.
    url(r'^entity/(?P<pk>\d+)/iptables/$', IptablesView.as_view(), name="entity_iptables"),
    # View for rendering zip file with iptables rules for all entities in a project.
    url(r'^project/(?P<project_id>\d+)/iptables/$', get_project_iptables, name="project_iptables"),
    # View for rendering zip file with iptables rules for all entities in a project for a specific location.
    url(r'^project/(?P<project_id>\d+)/location/(?P<location_id>\d+)/iptables/$', get_project_iptables, name="project_location_iptables"),
)