summaryrefslogtreecommitdiff
path: root/helsinki/program/urls_program.py
diff options
context:
space:
mode:
authorJohannes Raggam <raggam-nl@adm.at>2011-04-11 10:49:35 (GMT)
committerJohannes Raggam <raggam-nl@adm.at>2011-04-11 10:49:35 (GMT)
commit1eac93fabf853226cb0218cedec09106470a543b (patch)
tree6410790dbc38bd468ec7e266e3c7e191d1f48fa7 /helsinki/program/urls_program.py
parent720b0eca80ed449c07ae6c779e3420cdeb76ee6c (diff)
parentbb852483864a5c1be8cd99d2e05a3b1fc0ce0d5c (diff)
merge and updates
Diffstat (limited to 'helsinki/program/urls_program.py')
-rw-r--r--helsinki/program/urls_program.py50
1 files changed, 34 insertions, 16 deletions
diff --git a/helsinki/program/urls_program.py b/helsinki/program/urls_program.py
index 4f4b981..5462e10 100644
--- a/helsinki/program/urls_program.py
+++ b/helsinki/program/urls_program.py
@@ -2,22 +2,40 @@ from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_detail, object_list
-from models import Host, Show, TimeSlot
-from views import current_show, day_schedule, recommendations, show_list, today_schedule, week_schedule
+from models import BroadcastFormat, Host, Show, TimeSlot
+from views import current_show, day_schedule, recommendations, show_list, week_schedule
+
+host_dict = {
+ 'queryset': Host.objects.all(),
+ 'template_object_name': 'host'
+}
+show_dict = {
+ 'queryset': Show.objects.all(),
+ 'template_object_name': 'show'
+}
+timeslot_dict = {
+ 'queryset': TimeSlot.objects.all(),
+ 'template_object_name': 'timeslot'
+}
+broadcastformart_dict = {
+ 'queryset': BroadcastFormat.objects.all(),
+ 'template_name': 'program/broadcastformats_box.html',
+ 'template_object_name': 'broadcastformat'
+}
+recommendation_dict = {'template_name': 'program/recommendations_box.html'}
urlpatterns = patterns('',
- ('^/today/?$', today_schedule),
- ('^/(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/?$', day_schedule),
- ('^/(?P<year>\d{4})/(?P<week>\d{1,2})/?$', week_schedule),
- ('^/current_box/?$', current_show),
- ('^/hosts/?$', object_list, dict(template_object_name='host', queryset=Host.objects.all())),
- url('^/hosts/(?P<object_id>\d+)/?$', object_detail, dict(template_object_name='host', queryset=Host.objects.all()), name='host-detail'),
- ('^/tips/?$', recommendations),
- ('^/tips_box/?$', recommendations, dict(template_name='program/recommendations_box.html')),
- ('^/shows/?$', show_list),
- url('^/shows/(?P<slug>[\w-]+)/?$', object_detail, dict(template_object_name='show', queryset=Show.objects.all()), name='show-detail'),
- url('^/(?P<object_id>\d+)/?$', object_detail, dict(template_object_name='timeslot', queryset=TimeSlot.objects.all()), name='timeslot-detail'),
- # TODO: implement
- ('^/week/?$', today_schedule),
- ('^/broadcast_formats/?$', recommendations),
+ (r'^today/?$', day_schedule),
+ (r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/?$', day_schedule),
+ (r'^(?P<year>\d{4})/(?P<week>\d{1,2})/?$', week_schedule),
+ (r'^current_box/?$', current_show),
+ (r'^hosts/?$', object_list, host_dict),
+ url(r'^hosts/(?P<object_id>\d+)/?$', object_detail, host_dict, name='host-detail'),
+ (r'^tips/?$', recommendations),
+ (r'^tips_box/?$', recommendations, recommendation_dict),
+ (r'^shows/?$', show_list),
+ url(r'^shows/(?P<slug>[\w-]+)/?$', object_detail, show_dict, name='show-detail'),
+ url(r'^(?P<object_id>\d+)/?$', object_detail, timeslot_dict, name='timeslot-detail'),
+ (r'^broadcastformats_box/?$', object_list, broadcastformart_dict,),
+ (r'^week/?$', week_schedule)
)