From 805bd07400ff8f9eb72ef878a8880e63135a71d7 Mon Sep 17 00:00:00 2001 From: andreage Date: Thu, 14 Nov 2019 18:15:34 +0100 Subject: [PATCH] Updated `super()` to new usage in the docs (#1147) --- docs/guide/tips.txt | 4 ++-- docs/guide/usage.txt | 2 +- docs/ref/filters.txt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/guide/tips.txt b/docs/guide/tips.txt index 76563028e..eccdc4d30 100644 --- a/docs/guide/tips.txt +++ b/docs/guide/tips.txt @@ -173,7 +173,7 @@ for magic values. This is similar to the ``ChoiceFilter``'s null value handling. def filter(self, qs, value): if value != self.empty_value: - return super(MyCharFilter, self).filter(qs, value) + return super().filter(qs, value) qs = self.get_method(qs)(**{'%s__%s' % (self.name, self.lookup_expr): ""}) return qs.distinct() if self.distinct else qs @@ -243,4 +243,4 @@ If defaults are necessary though, the following should mimic the pre-1.0 behavio if not data.get(name) and initial: data[name] = initial - super(BaseFilterSet, self).__init__(data, *args, **kwargs) + super().__init__(data, *args, **kwargs) diff --git a/docs/guide/usage.txt b/docs/guide/usage.txt index 30180a44e..68fb21a96 100644 --- a/docs/guide/usage.txt +++ b/docs/guide/usage.txt @@ -197,7 +197,7 @@ those that are published and those that are owned by the logged-in user @property def qs(self): - parent = super(ArticleFilter, self).qs + parent = super().qs author = getattr(self.request, 'user', None) return parent.filter(is_published=True) \ diff --git a/docs/ref/filters.txt b/docs/ref/filters.txt index 54d2ce8f0..e534a896f 100644 --- a/docs/ref/filters.txt +++ b/docs/ref/filters.txt @@ -814,7 +814,7 @@ If you wish to sort by non-model fields, you'll need to add custom handling to a class CustomOrderingFilter(django_filters.OrderingFilter): def __init__(self, *args, **kwargs): - super(CustomOrderingFilter, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.extra['choices'] += [ ('relevance', 'Relevance'), ('-relevance', 'Relevance (descending)'), @@ -827,4 +827,4 @@ If you wish to sort by non-model fields, you'll need to add custom handling to a # sort queryset by relevance return ... - return super(CustomOrderingFilter, self).filter(qs, value) + return super().filter(qs, value)