1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Refs #23919 -- Replaced super(ClassName, self) with super() in docs.

This commit is contained in:
chillaranand
2017-01-22 12:27:14 +05:30
committed by Tim Graham
parent 2d96c027f5
commit dc165ec8e5
36 changed files with 103 additions and 104 deletions

View File

@@ -144,13 +144,13 @@ code snippet shows how you can implement this check::
class RangedIntegerField(models.IntegerField):
def __init__(self, min=None, max=None, **kwargs):
super(RangedIntegerField, self).__init__(**kwargs)
super().__init__(**kwargs)
self.min = min
self.max = max
def check(self, **kwargs):
# Call the superclass
errors = super(RangedIntegerField, self).check(**kwargs)
errors = super().check(**kwargs)
# Do some custom checks and add messages to `errors`:
errors.extend(self._check_min_max_values(**kwargs))
@@ -182,7 +182,7 @@ the only difference is that the check is a classmethod, not an instance method::
class MyModel(models.Model):
@classmethod
def check(cls, **kwargs):
errors = super(MyModel, cls).check(**kwargs)
errors = super().check(**kwargs)
# ... your own checks ...
return errors