Remove old Python 2.x style code

This commit is contained in:
Daniel Quinn 2018-09-02 21:26:06 +01:00
parent 39afe41f08
commit 729f005600
2 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@ from .models import Correspondent, Document, Tag
class CorrespondentFilterSet(FilterSet): class CorrespondentFilterSet(FilterSet):
class Meta(object): class Meta:
model = Correspondent model = Correspondent
fields = { fields = {
"name": [ "name": [
@ -18,7 +18,7 @@ class CorrespondentFilterSet(FilterSet):
class TagFilterSet(FilterSet): class TagFilterSet(FilterSet):
class Meta(object): class Meta:
model = Tag model = Tag
fields = { fields = {
"name": [ "name": [
@ -50,7 +50,7 @@ class DocumentFilterSet(FilterSet):
lookup_expr='isnull', lookup_expr='isnull',
distinct=True) distinct=True)
class Meta(object): class Meta:
model = Document model = Document
fields = { fields = {
"title": [ "title": [

View File

@ -5,14 +5,14 @@ from .models import Correspondent, Tag, Document, Log
class CorrespondentSerializer(serializers.HyperlinkedModelSerializer): class CorrespondentSerializer(serializers.HyperlinkedModelSerializer):
class Meta(object): class Meta:
model = Correspondent model = Correspondent
fields = ("id", "slug", "name") fields = ("id", "slug", "name")
class TagSerializer(serializers.HyperlinkedModelSerializer): class TagSerializer(serializers.HyperlinkedModelSerializer):
class Meta(object): class Meta:
model = Tag model = Tag
fields = ( fields = (
"id", "slug", "name", "colour", "match", "matching_algorithm") "id", "slug", "name", "colour", "match", "matching_algorithm")
@ -34,7 +34,7 @@ class DocumentSerializer(serializers.ModelSerializer):
view_name="drf:correspondent-detail", allow_null=True) view_name="drf:correspondent-detail", allow_null=True)
tags = TagsField(view_name="drf:tag-detail", many=True) tags = TagsField(view_name="drf:tag-detail", many=True)
class Meta(object): class Meta:
model = Document model = Document
fields = ( fields = (
"id", "id",
@ -57,7 +57,7 @@ class LogSerializer(serializers.ModelSerializer):
time = serializers.DateTimeField() time = serializers.DateTimeField()
messages = serializers.CharField() messages = serializers.CharField()
class Meta(object): class Meta:
model = Log model = Log
fields = ( fields = (
"time", "time",