24b28a504c
We can convert the entire search view to a generic class-based ListView. This is still one of the more disgusting views in the application and has a ton of logic scattered buckshot across several methods, but this commit is not meant to address all of that in one go. This is the last of the deprecated pieces I know of we are still using in the codebase, so we should be relatively safe in the long run now for an upgrade to the eventual next major Django release. Signed-off-by: Dan McGee <dan@archlinux.org>
44 lines
1.5 KiB
Python
44 lines
1.5 KiB
Python
from django.conf.urls import include, patterns
|
|
|
|
from .views.search import SearchListView
|
|
|
|
package_patterns = patterns('packages.views',
|
|
(r'^$', 'details'),
|
|
(r'^json/$', 'details_json'),
|
|
(r'^files/$', 'files'),
|
|
(r'^files/json/$', 'files_json'),
|
|
(r'^flag/$', 'flag'),
|
|
(r'^flag/done/$', 'flag_confirmed', {}, 'package-flag-confirmed'),
|
|
(r'^unflag/$', 'unflag'),
|
|
(r'^unflag/all/$', 'unflag_all'),
|
|
(r'^signoff/$', 'signoff_package'),
|
|
(r'^signoff/revoke/$', 'signoff_package', {'revoke': True}),
|
|
(r'^signoff/options/$', 'signoff_options'),
|
|
(r'^download/$', 'download'),
|
|
)
|
|
|
|
urlpatterns = patterns('packages.views',
|
|
(r'^flaghelp/$', 'flaghelp'),
|
|
(r'^signoffs/$', 'signoffs', {}, 'package-signoffs'),
|
|
(r'^signoffs/json/$', 'signoffs_json', {}, 'package-signoffs-json'),
|
|
(r'^update/$', 'update'),
|
|
|
|
(r'^$', SearchListView.as_view(), {}, 'packages-search'),
|
|
(r'^(?P<page>\d+)/$', SearchListView.as_view()),
|
|
(r'^search/json/$', 'search_json'),
|
|
|
|
(r'^differences/$', 'arch_differences', {}, 'packages-differences'),
|
|
(r'^stale_relations/$', 'stale_relations'),
|
|
(r'^stale_relations/update/$','stale_relations_update'),
|
|
|
|
(r'^(?P<name>[^ /]+)/$',
|
|
'details'),
|
|
(r'^(?P<repo>[A-z0-9\-]+)/(?P<name>[^ /]+)/$',
|
|
'details'),
|
|
# canonical package url. subviews defined above
|
|
(r'^(?P<repo>[A-z0-9\-]+)/(?P<arch>[A-z0-9]+)/(?P<name>[^ /]+)/',
|
|
include(package_patterns)),
|
|
)
|
|
|
|
# vim: set ts=4 sw=4 et:
|