aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Sipma <gueux@gueux.org>2013-07-25 12:56:48 +0200
committerFélix Sipma <gueux@gueux.org>2013-07-25 12:56:48 +0200
commit58779f1e5212aa1ae964d2e5fb6be82e979b0cb9 (patch)
treee9371e5f076fbf7967718bdedef6bad51ac592db
parent00befb3e32781312aaa11d3a52f44c565d45dafd (diff)
videodb.urls: pep8, remove useless imports
-rw-r--r--videodb/urls.py56
1 files changed, 33 insertions, 23 deletions
diff --git a/videodb/urls.py b/videodb/urls.py
index d03c572..b2534ec 100644
--- a/videodb/urls.py
+++ b/videodb/urls.py
@@ -1,6 +1,6 @@
"""urls file."""
from django.conf import settings
-from django.conf.urls.defaults import patterns, include, url
+from django.conf.urls import patterns, include, url
import os
from django.contrib.auth.decorators import login_required
@@ -10,10 +10,6 @@ from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
admin.autodiscover()
-from django.contrib.auth.views import login
-
-from django.conf.urls.defaults import *
-
from videodb.models import Movie
from videodb.views import MovieListView, MovieDetailView, MovieCreateView, \
@@ -24,44 +20,59 @@ from dajaxice.core import dajaxice_autodiscover, dajaxice_config
dajaxice_autodiscover()
-
urlpatterns = patterns('',
url(r'^$', MovieListView.as_view(), name='home'),
url(r'movie/all/$',
MovieListView.as_view(
- queryset=Movie.objects.order_by("title"),
- ),
+ queryset=Movie.objects.order_by("title"),
+ ),
name='movie_all'),
url(r'movie/latest/$',
MovieListView.as_view(
- queryset=Movie.objects.order_by("-pub_date"),
- ),
+ queryset=Movie.objects.order_by("-pub_date"),
+ ),
name='movie_latest'),
url(r'movie/not_seen/$',
login_required(MovieNotSeenListView.as_view(
- queryset=Movie.objects.order_by("-rating"),
- )),
+ queryset=Movie.objects.order_by("-rating"),
+ )),
name='movie_not_seen'),
url(r'movie/list/',
login_required(MovieListView.as_view()),
name='movie_list'),
- url(r'movie/(?P<pk>\d+)/$', MovieDetailView.as_view(), name='movie_detail'),
- url(r'movie/(?P<pk>\d+)/toggle_seen/$', login_required(MovieToggleSeen.as_view()), name='movie_toggle_seen'),
- url(r'movie/(?P<pk>\d+)/update/$', MovieUpdateView.as_view(), name='movie_update'),
- url(r'movie/(?P<pk>\d+)/delete/$', MovieDeleteView.as_view(), name='movie_delete'),
- url(r'movie/add/$', MovieCreateView.as_view(), name='movie_add'),
+ url(r'movie/(?P<pk>\d+)/$', MovieDetailView.as_view(),
+ name='movie_detail'),
+ url(r'movie/(?P<pk>\d+)/toggle_seen/$',
+ login_required(MovieToggleSeen.as_view()),
+ name='movie_toggle_seen'),
+ url(r'movie/(?P<pk>\d+)/update/$',
+ MovieUpdateView.as_view(), name='movie_update'),
+ url(r'movie/(?P<pk>\d+)/delete/$',
+ MovieDeleteView.as_view(), name='movie_delete'),
+ url(r'movie/add/$', MovieCreateView.as_view(),
+ name='movie_add'),
url(r'admin/', include(admin.site.urls)),
- url(r'accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'videodb/login.html'}, name='login'),
- url(r'accounts/logout/$', 'django.contrib.auth.views.logout', {'template_name': 'videodb/logout.html'}, name='logout'),
- url(r'accounts/(?P<pk>\d+)/$', UserProfileDetailView.as_view(), name='userprofile_detail'),
- url(dajaxice_config.dajaxice_url, include('dajaxice.urls')),
+ url(r'accounts/login/$',
+ 'django.contrib.auth.views.login',
+ {'template_name': 'videodb/login.html'},
+ name='login'),
+ url(r'accounts/logout/$',
+ 'django.contrib.auth.views.logout',
+ {'template_name': 'videodb/logout.html'},
+ name='logout'),
+ url(r'accounts/(?P<pk>\d+)/$',
+ UserProfileDetailView.as_view(),
+ name='userprofile_detail'),
+ url(dajaxice_config.dajaxice_url,
+ include('dajaxice.urls')),
url(r'^search/', MovieSearchView(), name='search'),
)
if settings.SERVE_MEDIA:
urlpatterns += patterns('',
- url(r'', include("django.contrib.staticfiles.urls")),
+ url(r'',
+ include("django.contrib.staticfiles.urls")),
url(r'^site_media/(?P<path>.*)$',
'django.views.static.serve',
{'document_root':
@@ -70,4 +81,3 @@ if settings.SERVE_MEDIA:
)
urlpatterns += staticfiles_urlpatterns()
-