from instinctual.informer.models import Project from instinctual.informer import relativeUrl as rel conf = instinctual.getConf() root = informer.getServerRoot() pat_project = "(?P<project_name>[^/]+)" pat_shot = "(?P<shot_name>[^/]+)" url_api = informer.getApiFragment() url_projects = rel(informer.getProjectsUrl(format='html')) url_project_print = rel(informer.getProjectPrintUrl(pat_project, format='html')) url_project_shots = rel(informer.getProjectShotsUrl(pat_project, format='html')) url_project_shots_alt = url_projects + pat_project + '/' url_project_shot = rel(informer.getProjectShotUrl(pat_project, pat_shot, format='html')) url_project_shot_notes = rel(informer.getProjectShotNotesUrl(pat_project, pat_shot, format='html')) url_project_shot_elements = rel(informer.getProjectShotElementsUrl(pat_project, pat_shot, format='html')) url_project_shot_renders = rel(informer.getProjectShotRendersUrl(pat_project, pat_shot, format='html')) # -------------------- # base patterns: # urlpatterns = patterns('', (r'^admin/', include('django.contrib.admin.urls')), (r'^' + url_api + '/', include('instinctual.informer.urls')), (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': media_path}), (r'^accounts/login/$', 'django.contrib.auth.views.login'), (r'^accounts/logout/$', 'django.contrib.auth.views.logout'), (r'^/?$', 'instinctual.informer.views.project_list'),
def get_absolute_url(self): project = self.project.name return informer.getProjectShotUrl(project, self.name, format='html')