urls.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. from django.conf.urls import patterns, url, include
  2. from django.views.decorators.cache import cache_page
  3. from django.views.generic import TemplateView
  4. from core import views
  5. urlpatterns = patterns(
  6. # public urls
  7. '',
  8. url(
  9. r'^i18n/',
  10. include('django.conf.urls.i18n')
  11. ),
  12. url(r'^candidates/$',
  13. views.candidates_view,
  14. name='candidates'
  15. ),
  16. url(r'^compare/$',
  17. views.compare_view,
  18. name='compare'
  19. ),
  20. url(r'^compare/reset/$',
  21. views.compare_reset_view,
  22. name='compare_reset'
  23. ),
  24. url(r'^partners/$',
  25. cache_page(3600)(TemplateView.as_view(template_name='partners.html')),
  26. name='partners'
  27. ),
  28. # private politician urls
  29. url(r'^politician/(?P<unique_key>[^/]+)/edit/$',
  30. views.politician_edit_view,
  31. name='politician_edit'
  32. ),
  33. url(r'^politician/(?P<unique_key>[^/]+)/edit/profile/$',
  34. views.politician_edit_profile_view,
  35. name='politician_edit_profile'
  36. ),
  37. url(r'^politician/(?P<unique_key>[^/]+)/edit/questions/$',
  38. views.politician_edit_questions_view,
  39. name='politician_edit_questions'
  40. ),
  41. url(r'^politician/(?P<unique_key>[^/]+)/answer/$',
  42. views.politician_answer_view,
  43. name='politician_answer'
  44. ),
  45. url(r'^politician/(?P<unique_key>[^/]+)/publish/$',
  46. views.politician_publish_view,
  47. name='politician_publish'
  48. ),
  49. url(r'^politician/(?P<unique_key>[^/]+)/unpublish/$',
  50. views.politician_unpublish_view,
  51. name='politician_unpublish'
  52. ),
  53. url(r'^politician/(?P<unique_key>[^/]+)/link/add/$',
  54. views.politician_link_add_view,
  55. name='politician_link_add'
  56. ),
  57. url(r'^politician/(?P<unique_key>[^/]+)/link/(?P<link_id>\d+)/delete/$',
  58. views.politician_link_delete_view,
  59. name='politician_link_delete'
  60. ),
  61. # public politician urls
  62. url(r'^politician/(?P<politician_id>\d+)/$',
  63. views.politician_view,
  64. name='politician'
  65. ),
  66. url(r'^politician/(?P<politician_id>\d+)/statistic/$',
  67. views.politician_statistic_view,
  68. name='politician_statistic'
  69. ),
  70. url(r'^politician/(?P<politician_id>\d+)/statistic/spider/$',
  71. views.politician_statistic_spider_view,
  72. name='politician_statistic_spider'
  73. ),
  74. # party urls
  75. url(r'^party/(?P<party_name>\w+)/login/$',
  76. views.party_login_view,
  77. name='party_login'
  78. ),
  79. url(r'^party/(?P<party_name>\w+)/logout/$',
  80. views.party_logout_view,
  81. name='party_logout'
  82. ),
  83. url(r'^party/(?P<party_name>\w+)/$',
  84. views.party_dashboard_view,
  85. name='party_dashboard'
  86. ),
  87. url(r'^party/(?P<party_name>\w+)/export/$',
  88. views.party_export_view,
  89. name='party_export'
  90. ),
  91. url(r'^party/(?P<party_name>\w+)/politician/add/$',
  92. views.party_politician_add_view,
  93. name='party_politician_add'
  94. ),
  95. url(r'^party/(?P<party_name>\w+)/politician/(?P<politician_id>\d+)/edit/$',
  96. views.party_politician_edit_view,
  97. name='party_politician_edit'
  98. ),
  99. url(
  100. r'^party/(?P<party_name>\w+)/politician/(?P<politician_id>\d+)/delete/$',
  101. views.party_politician_delete_view,
  102. name='party_politician_delete'
  103. ),
  104. )