Commit 6ce2b208 authored by Claude Paroz's avatar Claude Paroz

Remove/replace old-style generic views

parent 662ac1d2
from django.conf.urls.defaults import *
from teams.models import Team
from django.conf.urls.defaults import patterns, url
info_dict = {
'queryset': Team.objects.all(),
'template_object_name': 'team',
'slug_field': 'name',
'extra_context': {
'pageSection': "teams"
}
}
urlpatterns = patterns('',
urlpatterns = patterns('teams.views',
url(
regex = r'^(?P<format>(xml))?/?$',
view = 'teams.views.teams',
view = 'teams',
name = 'teams'),
url(
regex = r'^(?P<team_slug>[\w\-@]+)/$',
view = 'teams.views.team',
view = 'team',
name = 'team_slug'),
url(
regex = r'^(?P<team_slug>[\w\-@]+)/edit/',
view = 'teams.views.team_edit',
view = 'team_edit',
name = 'team_edit'),
url(
regex = r'^(?P<object_id>\d+)',
view = 'django.views.generic.list_detail.object_detail',
kwargs = dict(info_dict),
name = 'team')
)
from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
admin.autodiscover()
......@@ -19,8 +20,7 @@ urlpatterns = patterns('',
name = 'register'),
url(
regex = r'^register/success$',
view = 'django.views.generic.simple.direct_to_template',
kwargs = {'template': 'registration/register_success.html'},
view = TemplateView.as_view(template_name="registration/register_success.html"),
name = 'register_success'),
url(
regex = r'^register/activate/(?P<key>\w+)$',
......
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