From dc165ec8e5698ffc6dee6b510f1f92c9fd7467fe Mon Sep 17 00:00:00 2001 From: chillaranand Date: Sun, 22 Jan 2017 12:27:14 +0530 Subject: Refs #23919 -- Replaced super(ClassName, self) with super() in docs. --- docs/ref/models/expressions.txt | 6 +++--- docs/ref/models/instances.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/ref/models') diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index f53f791ffc..6947b18554 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -300,7 +300,7 @@ The ``Func`` API is as follows: ... def as_mysql(self, compiler, connection): - return super(ConcatPair, self).as_sql( + return super().as_sql( compiler, connection, function='CONCAT_WS', template="%(function)s('', %(expressions)s)", @@ -388,7 +388,7 @@ SQL that is generated. Here's a brief example:: template = '%(function)s(%(distinct)s%(expressions)s)' def __init__(self, expression, distinct=False, **extra): - super(Count, self).__init__( + super().__init__( expression, distinct='DISTINCT ' if distinct else '', output_field=IntegerField(), @@ -776,7 +776,7 @@ an ``__init__()`` method to set some attributes:: template = 'COALESCE( %(expressions)s )' def __init__(self, expressions, output_field): - super(Coalesce, self).__init__(output_field=output_field) + super().__init__(output_field=output_field) if len(expressions) < 2: raise ValueError('expressions must have at least 2 elements') for expression in expressions: diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index 058fd59512..5510105ccb 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -113,7 +113,7 @@ are loaded from the database:: if not self._state.adding and ( self.creator_id != self._loaded_values['creator_id']): raise ValueError("Updating the value of creator isn't allowed") - super(...).save(*args, **kwargs) + super().save(*args, **kwargs) The example above shows a full ``from_db()`` implementation to clarify how that is done. In this case it would of course be possible to just use ``super()`` call @@ -184,7 +184,7 @@ all of the instance's fields when a deferred field is reloaded:: if fields.intersection(deferred_fields): # then load all of them fields = fields.union(deferred_fields) - super(ExampleModel, self).refresh_from_db(using, fields, **kwargs) + super().refresh_from_db(using, fields, **kwargs) .. method:: Model.get_deferred_fields() -- cgit v1.3