Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 63020b4

Browse files
committed
Including packaging to the isort command that checks example.
1 parent f0bda69 commit 63020b4

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

‎.travis.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ script:
4949
- isort --check-only --verbose --recursive --diff rest_framework_json_api
5050
# example has extra dependencies that are installed in a dev environment
5151
# but are not installed in CI. Explicitly set those packages.
52-
- isort --check-only --verbose --recursive --diff --thirdparty pytest --thirdparty polymorphic --thirdparty pytest_factoryboy example
52+
- isort --check-only --verbose --recursive --diff --thirdparty pytest --thirdparty polymorphic --thirdparty pytest_factoryboy --thirdparty packaging example
5353
- coverage run setup.py -v test
5454
after_success:
5555
- codecov

‎example/serializers.py‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from datetime import datetime
22

33
import rest_framework
4-
54
from packaging import version
5+
66
from rest_framework_json_api import relations, serializers
77

88
from example.models import (
@@ -20,14 +20,12 @@
2020

2121

2222
class TaggedItemSerializer(serializers.ModelSerializer):
23-
2423
class Meta:
2524
model = TaggedItem
26-
fields = ('tag',)
25+
fields = ('tag',)
2726

2827

2928
class BlogSerializer(serializers.ModelSerializer):
30-
3129
copyright = serializers.SerializerMethodField()
3230
tags = TaggedItemSerializer(many=True, read_only=True)
3331

@@ -46,12 +44,11 @@ def get_root_meta(self, resource, many):
4644
class Meta:
4745
model = Blog
4846
fields = ('name', 'url', 'tags')
49-
read_only_fields = ('tags',)
47+
read_only_fields = ('tags',)
5048
meta_fields = ('copyright',)
5149

5250

5351
class EntrySerializer(serializers.ModelSerializer):
54-
5552
def __init__(self, *args, **kwargs):
5653
super(EntrySerializer, self).__init__(*args, **kwargs)
5754
# to make testing more concise we'll only output the
@@ -97,15 +94,14 @@ class Meta:
9794
model = Entry
9895
fields = ('blog', 'headline', 'body_text', 'pub_date', 'mod_date',
9996
'authors', 'comments', 'featured', 'suggested', 'tags')
100-
read_only_fields = ('tags',)
97+
read_only_fields = ('tags',)
10198
meta_fields = ('body_format',)
10299

103100
class JSONAPIMeta:
104101
included_resources = ['comments']
105102

106103

107104
class AuthorBioSerializer(serializers.ModelSerializer):
108-
109105
class Meta:
110106
model = AuthorBio
111107
fields = ('author', 'body')

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /