comparison apps/bundle/urls.py @ 177:86129d185ddb

Add versioning to bundles Some other bundle-related changes were made, including: * Editing the snippetform CSS and HTML to allow bundle/form.djhtml to be reused for editing * Changing {% block title %} to {% block section %} in the base template for bundles to allow for more flexibility when creating breadcrumbs * Saved common URL patterns in variables in bundle/urls.py * Renamed explore.html to explore.djhtml for consistency You should now be able to upload new versions as well as view the files (or a particular file) for a bundle at a specific version. Coming soon: the ability to add a timestamp and a comment for each new uploaded version (if this feature is desirable).
author dellsystem <ilostwaldo@gmail.com>
date Sat, 20 Oct 2012 23:28:50 -0400
parents c7be7def8b57
children 4033ebe1867f
comparison
equal deleted inserted replaced
176:c042d26e6936 177:86129d185ddb
1 from django.conf.urls.defaults import * 1 from django.conf.urls.defaults import *
2 2
3 3
4 BUNDLE_PATTERN = r'^(?P<user>[^/]*)/(?P<bundle>[^/]+)'
5 VERSION_PATTERN = '(?P<version>\d+)'
6
7
4 urlpatterns = patterns('apps.bundle.views', 8 urlpatterns = patterns('apps.bundle.views',
5 url(r'^(?P<user>[^/]+)/(?P<bundle>[^/]+)/(?P<path>.+)/$', 'file_detail', 9 url(BUNDLE_PATTERN + '/?$', 'detail', name='bundle_details'),
6 name='bundlefile_details'), 10 url(BUNDLE_PATTERN + '/' + VERSION_PATTERN + '/?$', 'detail',
7 url(r'^(?P<user>.*)/(?P<bundle>.*)/$', 'detail', name='bundle_details'), 11 name='bundle_version'),
12 url(BUNDLE_PATTERN + '/edit', 'edit', name='bundle_edit'),
13 url(BUNDLE_PATTERN + '/' + VERSION_PATTERN + '/(?P<path>.+)/?$',
14 'file_detail', name='bundlefile_details'),
8 url(r'^$', 'index', name='bundle_new'), 15 url(r'^$', 'index', name='bundle_new'),
9 url(r'^explore$', 'explore', name='bundle_explore'), 16 url(r'^explore$', 'explore', name='bundle_explore'),
10 ) 17 )