﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26660	Remove ugly .as_view() requeriment	john-bonachon	nobody	"Let's take this ''urls.py'' as an example,


{{{
from django.conf.urls import url

from . import views

app_name = 'polls'

urlpatterns = [
    url(r'^$', views.IndexView.as_view(), name='index'),
    url(r'^(?P<pk>[0-9]+)/$', views.DetailView.as_view(), name='detail'),
    url(r'^(?P<pk>[0-9]+)/results/$', views.ResultsView.as_view(), name='results'),
    url(r'^(?P<question_id>[0-9]+)/vote/$', views.vote, name='vote'),
]
}}}

Is there any elegant ""trick"" to avoid calling the method .as_view() and make the Class View callable? I'm not sure if using {{{__call__}}} magic function on django.views.generic.View would help on this.

It may have sense to make the developer remember that you must send a callable that will receive an HttpRequest plus the regex arguments, however url() is also accepting a list or tuple for include() processing, so I wonder if we could also just send the Class View."	Uncategorized	closed	Core (URLs)	1.9	Normal	wontfix			Unreviewed	0	0	0	0	0	0
