mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #23919 -- Stopped inheriting from object to define new style classes.
This commit is contained in:
parent
a556396339
commit
cecc079168
293 changed files with 512 additions and 514 deletions
|
@ -1,7 +1,7 @@
|
|||
from django.conf.urls import url
|
||||
|
||||
|
||||
class ViewContainer(object):
|
||||
class ViewContainer:
|
||||
def method_view(self, request):
|
||||
pass
|
||||
|
||||
|
|
|
@ -518,7 +518,7 @@ class ReverseShortcutTests(SimpleTestCase):
|
|||
|
||||
def test_redirect_to_object(self):
|
||||
# We don't really need a model; just something with a get_absolute_url
|
||||
class FakeObj(object):
|
||||
class FakeObj:
|
||||
def get_absolute_url(self):
|
||||
return "/hi-there/"
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ from django.conf.urls import url
|
|||
from . import views
|
||||
|
||||
|
||||
class URLObject(object):
|
||||
class URLObject:
|
||||
urlpatterns = [
|
||||
url(r'^inner/$', views.empty_view, name='urlobject-view'),
|
||||
url(r'^inner/(?P<arg1>[0-9]+)/(?P<arg2>[0-9]+)/$', views.empty_view, name='urlobject-view'),
|
||||
|
|
|
@ -35,7 +35,7 @@ def pass_resolver_match_view(request, *args, **kwargs):
|
|||
uncallable = None # neither a callable nor a string
|
||||
|
||||
|
||||
class ViewClass(object):
|
||||
class ViewClass:
|
||||
def __call__(self, request, *args, **kwargs):
|
||||
return HttpResponse('')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue