source: telemeta/urls.py @ 01bf9f7

cremcrem2crem3devdev2diademsdj1.6feature/breadcrumbsfeature/ts-0.5feature/ts-0.5.4feature/writecacheformagenericinstru_searchlamlam2mapsv3mergenlivemultiproductionrelease/1.4.4sabiodsearchsecurityserversocialstoragetelecastertestvideo
Last change on this file since 01bf9f7 was 01bf9f7, checked in by olivier <>, 8 years ago
  • add dublin core modelization and new to_dublincore() model methods
  • improved dublin core mapping
  • add dublin core HTML-based views of collections and items
  • fixed URL handling with non aplhanumeric record IDs
  • fix #21: the web view now properly handle export streams
  • turn the model list() method into the tolist template filter
  • new submenu template block + css fixes
  • Property mode set to 100644
File size: 3.8 KB
Line 
1# Copyright (C) 2007 Samalyse SARL
2# All rights reserved.
3#
4# This software is licensed as described in the file COPYING, which
5# you should have received as part of this distribution. The terms
6# are also available at http://svn.parisson.org/telemeta/TelemetaLicense.
7#
8# Author: Olivier Guilyardi <olivier@samalyse.com>
9
10from django.conf.urls.defaults import *
11from telemeta.models import MediaItem, MediaCollection
12from telemeta.core import ComponentManager
13from telemeta.views.web import WebView
14
15# initialization
16comp_mgr = ComponentManager()
17web_view = WebView(comp_mgr)
18
19# query sets for Django generic views
20all_items = { 'queryset': MediaItem.objects.all(), }
21all_collections = { 'queryset': MediaCollection.objects.all(), }
22
23urlpatterns = patterns('',
24    (r'^$', web_view.index),
25
26    # items
27    url(r'^items/$', 'django.views.generic.list_detail.object_list', 
28        dict(all_items, paginate_by=20, template_name="mediaitem_list.html"),
29        name="telemeta-items"),
30    url(r'^items/(?P<item_id>[0-9A-Z._:%?-]+)/$', web_view.item_detail, 
31        name="telemeta-item-detail"),
32    url(r'^items/(?P<item_id>[0-9A-Z._:%?-]+)/dc/$', web_view.item_detail, 
33        {'template': 'mediaitem_detail_dc.html'},
34        name="telemeta-item-dublincore"),
35    url(r'^items/(?P<item_id>[0-9A-Z._:%?-]+)/dc/xml/$', web_view.item_detail, 
36        {'format': 'dublin_core_xml'},
37        name="telemeta-item-dublincore-xml"),
38    url(r'^items/(?P<item_id>[0-9A-Z._:%?-]+)/download/(?P<format>[0-9A-Z]+)/$', 
39        web_view.item_export,
40        name="telemeta-item-export"),
41    url(r'^items/(?P<item_id>[0-9A-Z._:%?-]+)/visualize/(?P<visualizer_id>[0-9a-z]+)/$', 
42        web_view.item_visualize,
43        name="telemeta-item-visualize"),
44
45    # collections
46    url(r'^collections/$', 'django.views.generic.list_detail.object_list',
47        dict(all_collections, paginate_by=20, 
48            template_name="collection_list.html"),
49        name="telemeta-collections"),
50    url(r'^collections/?page=(?P<page>[0-9]+)$', 
51        'django.views.generic.list_detail.object_list',
52        dict(all_collections, paginate_by=20)),
53    url(r'^collections/(?P<object_id>[0-9A-Z._%?-]+)/$', 
54        'django.views.generic.list_detail.object_detail',
55        dict(all_collections, template_name="collection_detail.html"),
56        name="telemeta-collection-detail"),
57    url(r'^collections/(?P<object_id>[0-9A-Z._%?-]+)/dc/$', 
58        'django.views.generic.list_detail.object_detail',
59        dict(all_collections, template_name="collection_detail_dc.html"),
60        name="telemeta-collection-dublincore"),
61
62    # search
63    url(r'^search/$', web_view.quick_search, name="telemeta-quicksearch"),
64
65    # administration       
66    url(r'^admin/$', web_view.admin_index, name="telemeta-admin"),       
67
68    # dictionaries administration
69    url(r'^admin/dictionaries/(?P<dictionary_id>[0-9a-z]+)/$', 
70        web_view.edit_dictionary ,
71        name="telemeta-dictionary-edit"),       
72    url(r'^admin/dictionaries/(?P<dictionary_id>[0-9a-z]+)/add/$', 
73        web_view.add_to_dictionary,
74        name="telemeta-dictionary-add"),       
75    url(r'^admin/dictionaries/(?P<dictionary_id>[0-9a-z]+)/update/$', 
76        web_view.update_dictionary,
77        name="telemeta-dictionary-update"),       
78    url(r'^admin/dictionaries/(?P<dictionary_id>[0-9a-z]+)/(?P<value_id>[0-9]+)/$',
79        web_view.edit_dictionary_value,
80        name="telemeta-dictionary-record-edit"),   
81
82    url(r'^admin/dictionaries/(?P<dictionary_id>[0-9a-z]+)/(?P<value_id>[0-9]+)/update/$',
83        web_view.update_dictionary_value, 
84        name="telemeta-dictionary-record-update"),   
85
86
87    # CSS+Images (FIXME: for developement only)
88    (r'^css/(?P<path>.*)$', 'django.views.static.serve', 
89        {'document_root': './telemeta/htdocs/css'}),
90    (r'^images/(?P<path>.*)$', 'django.views.static.serve', 
91        {'document_root': './telemeta/htdocs/images'}),
92)
Note: See TracBrowser for help on using the repository browser.