From 5e76aad19808ea7a0496115e066815a3d42648ea Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 11 Jan 2011 11:37:50 +0100 Subject: [PATCH] add - to item regexp --- telemeta/models/media.py | 8 ++++---- telemeta/urls.py | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/telemeta/models/media.py b/telemeta/models/media.py index 6038f42d..4e21a9b9 100644 --- a/telemeta/models/media.py +++ b/telemeta/models/media.py @@ -70,8 +70,8 @@ class MediaCollection(MediaResource): element_type = 'collection' PUBLIC_ACCESS_CHOICES = (('none', 'none'), ('metadata', 'metadata'), ('full', 'full')) - published_code_regex = '[A-Za-z0-9._]*' - unpublished_code_regex = '[A-Za-z0-9._]*' + published_code_regex = '[A-Za-z0-9._-]*' + unpublished_code_regex = '[A-Za-z0-9._-]*' code_regex = '(?:%s|%s)' % (published_code_regex, unpublished_code_regex) reference = CharField(_('reference'), unique=True, null=True) @@ -208,8 +208,8 @@ class MediaItem(MediaResource): element_type = 'item' PUBLIC_ACCESS_CHOICES = (('none', 'none'), ('metadata', 'metadata'), ('full', 'full')) - published_code_regex = '[A-Za-z0-9._]*' - unpublished_code_regex = '[A-Za-z0-9._]*' + published_code_regex = '[A-Za-z0-9._-]*' + unpublished_code_regex = '[A-Za-z0-9._-]*' code_regex = '(?:%s|%s)' % (published_code_regex, unpublished_code_regex) collection = ForeignKey('MediaCollection', related_name="items", diff --git a/telemeta/urls.py b/telemeta/urls.py index a9603b10..5cf4ffba 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -61,25 +61,25 @@ urlpatterns = patterns('', url(r'^items/$', 'django.views.generic.list_detail.object_list', dict(all_items, paginate_by=20, template_name="telemeta/mediaitem_list.html"), name="telemeta-items"), - url(r'^items/(?P[A-Za-z0-9._]+)/$', web_view.item_detail, + url(r'^items/(?P[A-Za-z0-9._-]+)/$', web_view.item_detail, name="telemeta-item-detail"), - url(r'^items/(?P[A-Za-z0-9._]+)/dc/$', web_view.item_detail, + url(r'^items/(?P[A-Za-z0-9._-]+)/dc/$', web_view.item_detail, {'template': 'telemeta/mediaitem_detail_dc.html'}, name="telemeta-item-dublincore"), - url(r'^items/(?P[A-Za-z0-9._]+)/dc/xml/$', web_view.item_detail, + url(r'^items/(?P[A-Za-z0-9._-]+)/dc/xml/$', web_view.item_detail, {'format': 'dublin_core_xml'}, name="telemeta-item-dublincore-xml"), - url(r'^items/download/(?P[A-Za-z0-9._]+)\.(?P' + url(r'^items/download/(?P[A-Za-z0-9._-]+)\.(?P' + export_extensions + ')$', web_view.item_export, name="telemeta-item-export"), - url(r'^items/(?P[A-Za-z0-9._]+)/visualize/(?P[0-9a-z_]+)/(?P[0-9A-Z]+)x(?P[0-9A-Z]+)/$', + url(r'^items/(?P[A-Za-z0-9._-]+)/visualize/(?P[0-9a-z_]+)/(?P[0-9A-Z]+)x(?P[0-9A-Z]+)/$', web_view.item_visualize, name="telemeta-item-visualize"), - url(r'^items/(?P[A-Za-z0-9._]+)/analyze/(?P[0-9a-z_]+)/$', + url(r'^items/(?P[A-Za-z0-9._-]+)/analyze/(?P[0-9a-z_]+)/$', web_view.item_analyze, name="telemeta-item-analyze"), - url(r'^items/(?P[A-Za-z0-9._]+)/item_xspf.xml$', + url(r'^items/(?P[A-Za-z0-9._-]+)/item_xspf.xml$', web_view.item_playlist, dict(template="telemeta/mediaitem_xspf.xml", mimetype="application/xspf+xml"), name="telemeta-item-xspf"), @@ -92,15 +92,15 @@ urlpatterns = patterns('', url(r'^collections/?page=(?P[0-9]+)$', 'django.views.generic.list_detail.object_list', dict(all_collections, paginate_by=20)), - url(r'^collections/(?P[A-Za-z0-9._]+)/$', web_view.collection_detail, + url(r'^collections/(?P[A-Za-z0-9._-]+)/$', web_view.collection_detail, dict(template="telemeta/collection_detail.html"), name="telemeta-collection-detail"), - url(r'^collections/(?P[A-Za-z0-9._]+)/dc/$', web_view.collection_detail, + url(r'^collections/(?P[A-Za-z0-9._-]+)/dc/$', web_view.collection_detail, dict(template="telemeta/collection_detail_dc.html"), name="telemeta-collection-dublincore"), - url(r'^collections/(?P[A-Za-z0-9._]+)/collection_xspf.xml$', + url(r'^collections/(?P[A-Za-z0-9._-]+)/collection_xspf.xml$', web_view.collection_playlist, dict(template="telemeta/collection_xspf.xml", mimetype="application/xspf+xml"), name="telemeta-collection-xspf"), - url(r'^collections/(?P[A-Za-z0-9._]+)/collection.m3u$', + url(r'^collections/(?P[A-Za-z0-9._-]+)/collection.m3u$', web_view.collection_playlist, dict(template="telemeta/collection.m3u", mimetype="audio/mpegurl"), name="telemeta-collection-m3u"), -- 2.39.5