Commit 00436026 authored by okhin's avatar okhin 🚴

Merge branch 'django-1.8' into 'master'

Django 1.8 - Class Based view

Class Basd view wherever it was possible. The code is a bit cleaner now.

See merge request !4
parents dccf375b 849b1779
This diff is collapsed.
......@@ -122,5 +122,4 @@
{% endfor %}
</tbody>
</table>
</div>
{%endblock%}
......@@ -14,22 +14,22 @@ admin.autodiscover()
urlpatterns = patterns('',
url(r'^$',
view=bt.index,
view=bt.AddForm.as_view(),
name="homepage"),
url(r'^list/$',
view=bt.list_violations,
view=bt.ViolationsList.as_view(),
name="list_violations"),
url(r'^list/(?P<country>[^/]*)(/(?P<operator>[^/]*))?$',
view=bt.filter_violations,
name="filter"),
url(r'^add/$',
view=bt.add,
name="add_violation"),
url(r'^list/(?P<country>\w+)/$',
view=bt.ViolationsList.as_view(),
name="filter_country"),
url(r'^list/(?P<country>\w+)/(?P<operator>\w+)/$',
view=bt.ViolationsList.as_view(),
name="filter_operator"),
# violation cannonical url and redirections
url(r'^(?P<id>[0-9]*)$',
RedirectView.as_view(url='/view/%(id)s')),
url(r'^view/(?P<id>[0-9]*)$',
view=bt.view,
view=bt.ViolationView.as_view(),
name="violation_url"),
url(r'^attach/(?P<id>[0-9]*)$',
view=bt.get_attach,
......@@ -60,7 +60,7 @@ urlpatterns = patterns('',
view=bt.moderate,
name="moderate"),
url(r'^lookup/$',
view=bt.lookup,
view=bt.LookupView.as_view(),
name="lookup"),
url(r'^accounts/logout$',
'django.contrib.auth.views.logout', {'next_page': '/'}),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment