Guest User

Untitled

a guest
Jul 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. cat urls.py
  2. from django.conf.urls.defaults import *
  3. from aur.models import Package
  4.  
  5. detail_dict = {
  6. 'queryset': Package.objects.all(),
  7. 'template_object_name': 'pkg',
  8. }
  9.  
  10. urlpatterns = patterns('aur.views',
  11. url(r'^$', 'search', name='aur-main'),
  12. url(r'^search/$', 'search', name='aur-search'),
  13. url(r'^submit/$', 'submit', name='aur-submit_package'),
  14. url(r'^package/(?P<object_id>[\w_-]+)/comment/$', 'comment',
  15. name='aur-comment_on_package'),
  16. url(r'^package/(?P<object_id>[\w_-]+)/flag_out_of_date/$',
  17. 'flag_out_of_date', name='aur-flag_out_of_date'),
  18. url(r'^package/(?P<object_id>[\w_-]+)/unflag_out_of_date/$',
  19. 'unflag_out_of_date', name='aur-unflag_out_of_date'),
  20. url(r'^package/(?P<object_id>[\w_-]+)/vote/$',
  21. 'vote', name='aur-vote'),
  22. url(r'^package/(?P<object_id>[\w_-]+)/unvote/$',
  23. 'unvote', name='aur-unvote'),
  24. url(r'^package/(?P<object_id>[\w_-]+)/notify_of_updates/$',
  25. 'notify_of_updates', name='aur-notify_of_updates'),
  26. url(r'^package/(?P<object_id>[\w_-]+)/denotify_of_updates/$',
  27. 'denotify_of_updates', name='aur-denotify_of_updates'),
  28. (r'^api/search/(?P<query>[\w\d_ -]+).(?P<format>(json|xml))$',
  29. 'api_search'),
  30. (r'^api/package/(?P<object_id>[\w_-]+).(?P<format>(json|xml))$',
  31. 'api_package_info'),
  32. (r'^api/package/(?P<object_id>[\w_-]+)/comments.(?P<format>(json|xml))$',
  33. 'api_package_comments'),
  34. url(r'^manage_packages/$', 'manage_packages', name='aur-manage_packages'),
  35. )
  36.  
  37. # Generic views
  38. # These will probably be removed at a later stage
  39. urlpatterns += patterns('django.views.generic',
  40. (r'^package/(?P<slug>[\w_-]+)/$', 'list_detail.object_detail',
  41. dict(detail_dict), 'aur-package_detail'),
  42. )
  43.  
  44.  
  45.  
  46.  
  47. C: 1: Missing docstring
  48. W: 1: Wildcard import django.conf.urls.defaults
  49. F: 2: Unable to import 'aur.models'
  50. C: 4: Invalid name "detail_dict" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
  51. C: 9: Invalid name "urlpatterns" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
  52. W: 1: Unused import include from wildcard import
  53. W: 1: Unused import handler404 from wildcard import
  54. W: 1: Unused import handler500 from wildcard import
Add Comment
Please, Sign In to add comment