summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorchillaranand <anand21nanda@gmail.com>2017-01-22 12:27:14 +0530
committerTim Graham <timograham@gmail.com>2017-01-25 11:53:05 -0500
commitdc165ec8e5698ffc6dee6b510f1f92c9fd7467fe (patch)
treeebcd5f708528b2aec195f9a97d28bd85653aa7dc /docs/ref/models
parent2d96c027f5eb32c2c09bd57df2240ae1d343b98e (diff)
Refs #23919 -- Replaced super(ClassName, self) with super() in docs.
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/expressions.txt6
-rw-r--r--docs/ref/models/instances.txt4
2 files changed, 5 insertions, 5 deletions
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()