addons-server/apps/versions/urls.py

25 строки
820 B
Python
Исходник Обычный вид История

2010-06-17 21:14:30 +04:00
from django.conf.urls.defaults import patterns, url
from versions.feeds import VersionsRss
2010-06-17 21:14:30 +04:00
2010-12-22 02:45:02 +03:00
from addons.urls import ADDON_ID
2010-06-17 21:14:30 +04:00
from . import views
urlpatterns = patterns('',
url('^$', views.version_list, name='addons.versions'),
url('^format:rss$', VersionsRss(), name='addons.versions.rss'),
url('^(?P<version_num>[^/]+)$', views.version_detail,
name='addons.versions'),
2010-06-17 21:14:30 +04:00
)
2010-08-26 19:50:05 +04:00
download_patterns = patterns('',
# .* at the end to match filenames.
# /file/:id/type:attachment
2010-11-05 00:14:49 +03:00
url('^file/(?P<file_id>\d+)(?:/type:(?P<type>\w+))?(?:/.*)?',
2010-08-26 19:50:05 +04:00
views.download_file, name='downloads.file'),
# /latest/1865/type:xpi/platform:5
2010-12-22 02:45:02 +03:00
url('^latest/%s/(?:type:(?P<type>\w+)/)?'
'(?:platform:(?P<platform>\d+)/)?.*' % ADDON_ID,
2010-08-26 19:50:05 +04:00
views.download_latest, name='downloads.latest'),
)