Skip to content

Commit c4337f1

Browse files
authored
clean up python 2 code (#976)
1 parent c763b97 commit c4337f1

27 files changed

+23
-63
lines changed

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# -*- coding: utf-8 -*-
2+
#
33
#
44
# Django REST framework JSON:API documentation build configuration file, created by
55
# sphinx-quickstart on Fri Jul 24 23:31:15 2015.

example/api/resources/identity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def posts(self, request):
3333
@action(detail=True)
3434
def manual_resource_name(self, request, *args, **kwargs):
3535
self.resource_name = "data"
36-
return super(Identity, self).retrieve(request, args, kwargs)
36+
return super().retrieve(request, args, kwargs)
3737

3838
@action(detail=True)
3939
def validation(self, request, *args, **kwargs):

example/factories.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# -*- encoding: utf-8 -*-
2-
31
import factory
42
from faker import Factory as FakerFactory
53

example/migrations/0001_initial.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.9.5 on 2016-05-02 08:26
3-
from __future__ import unicode_literals
4-
51
import django.db.models.deletion
62
from django.db import migrations, models
73

example/migrations/0002_taggeditem.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.10.5 on 2017-02-01 08:34
3-
from __future__ import unicode_literals
4-
51
import django.db.models.deletion
62
from django.db import migrations, models
73

example/migrations/0003_polymorphics.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.11.1 on 2017-05-17 14:49
3-
from __future__ import unicode_literals
4-
51
import django.db.models.deletion
62
from django.db import migrations, models
73

example/migrations/0004_auto_20171011_0631.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.11.6 on 2017-10-11 06:31
3-
from __future__ import unicode_literals
4-
51
import django.db.models.deletion
62
from django.db import migrations, models
73

example/models.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# -*- encoding: utf-8 -*-
2-
from __future__ import unicode_literals
3-
41
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
52
from django.contrib.contenttypes.models import ContentType
63
from django.db import models

example/serializers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Meta:
8383

8484
class EntrySerializer(serializers.ModelSerializer):
8585
def __init__(self, *args, **kwargs):
86-
super(EntrySerializer, self).__init__(*args, **kwargs)
86+
super().__init__(*args, **kwargs)
8787
# to make testing more concise we'll only output the
8888
# `featured` field when it's requested via `include`
8989
request = kwargs.get("context", {}).get("request")
@@ -379,7 +379,7 @@ class Meta:
379379

380380
class CurrentProjectRelatedField(relations.PolymorphicResourceRelatedField):
381381
def get_attribute(self, instance):
382-
obj = super(CurrentProjectRelatedField, self).get_attribute(instance)
382+
obj = super().get_attribute(instance)
383383

384384
is_art = self.field_name == "current_art_project" and isinstance(
385385
obj, ArtProject

example/tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def setUp(self):
1111
"""
1212
Create those users
1313
"""
14-
super(TestBase, self).setUp()
14+
super().setUp()
1515
self.create_users()
1616

1717
def create_user(self, username, email, password="pw", first_name="", last_name=""):

0 commit comments

Comments
 (0)