Skip to content

Commit

Permalink
Merge 6114c28 into e445132
Browse files Browse the repository at this point in the history
  • Loading branch information
dyohan9 committed Jul 18, 2019
2 parents e445132 + 6114c28 commit d310b64
Show file tree
Hide file tree
Showing 18 changed files with 443 additions and 32 deletions.
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ requests = "==2.20.1"
coreapi = "==2.3.3"
whitenoise = "==4.1.2"
pytz = "==2018.7"
drf-yasg = "*"

[dev-packages]
"flake8" = "*"
coverage = "*"
ipython = "*"
autopep8 = "*"
packaging = "*"

[requires]
python_version = "3.6"
115 changes: 86 additions & 29 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bothub/api/v1/serializers/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ class Meta:
'name',
'icon',
]
ref_name = None
6 changes: 6 additions & 0 deletions bothub/api/v1/serializers/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Meta:
'created_at',
'value',
]
ref_name = None

repository_example = serializers.PrimaryKeyRelatedField(
queryset=RepositoryExample.objects,
Expand Down Expand Up @@ -62,6 +63,7 @@ class Meta:
'entity',
'label',
]
ref_name = None

repository_example = serializers.PrimaryKeyRelatedField(
queryset=RepositoryExample.objects,
Expand Down Expand Up @@ -107,6 +109,7 @@ class Meta:
'repository_update',
'deleted_in',
]
ref_name = None

entities = RepositoryExampleEntitySerializer(
many=True,
Expand All @@ -132,6 +135,7 @@ class Meta:
'intent',
'entities',
]
ref_name = None

id = serializers.PrimaryKeyRelatedField(
read_only=True,
Expand Down Expand Up @@ -186,6 +190,7 @@ class Meta:
'value',
'label',
]
ref_name = None

label = serializers.SerializerMethodField()

Expand All @@ -203,6 +208,7 @@ class Meta:
'value',
'entities',
]
ref_name = None

repository = serializers.StringRelatedField(read_only=True)
entities = serializers.SlugRelatedField(
Expand Down
4 changes: 4 additions & 0 deletions bothub/api/v1/serializers/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Meta:
'description',
'is_private',
]
ref_name = None

uuid = serializers.ReadOnlyField(
style={'show': False})
Expand Down Expand Up @@ -86,6 +87,7 @@ class Meta:
'languages_warnings',
'created_at',
]
ref_name = None

owner = serializers.PrimaryKeyRelatedField(
read_only=True,
Expand Down Expand Up @@ -172,6 +174,7 @@ class Meta:
'is_admin',
'created_at',
]
ref_name = None

user__nickname = serializers.SlugRelatedField(
source='user',
Expand All @@ -194,6 +197,7 @@ class Meta:
fields = [
'role',
]
ref_name = None

def validate(self, data):
if self.instance.user == self.instance.repository.owner:
Expand Down
3 changes: 3 additions & 0 deletions bothub/api/v1/serializers/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Meta:
'repository',
'text',
]
ref_name = None

repository = serializers.PrimaryKeyRelatedField(
queryset=Repository.objects,
Expand Down Expand Up @@ -41,6 +42,7 @@ class Meta:
'approved_by__nickname',
'created_at',
]
ref_name = None

user__nickname = serializers.SlugRelatedField(
source='user',
Expand All @@ -58,6 +60,7 @@ class Meta:
fields = [
'approved_by'
]
ref_name = None

approved_by = serializers.PrimaryKeyRelatedField(
read_only=True,
Expand Down
2 changes: 2 additions & 0 deletions bothub/api/v1/serializers/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class Meta:
'entities',
'created_at',
]
ref_name = None

original_example = serializers.PrimaryKeyRelatedField(
queryset=RepositoryExample.objects,
Expand Down Expand Up @@ -100,6 +101,7 @@ class Meta:
'has_valid_entities',
'entities',
]
ref_name = None

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Expand Down
1 change: 1 addition & 0 deletions bothub/api/v1/serializers/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Meta:
'trained_at',
'failed_at',
]
ref_name = None

by__nickname = serializers.SlugRelatedField(
source='by',
Expand Down
2 changes: 2 additions & 0 deletions bothub/api/v1/serializers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Meta:
'nickname',
'password',
]
ref_name = None

password = PasswordField(
write_only=True,
Expand All @@ -38,6 +39,7 @@ class Meta:
'name',
'locale',
]
ref_name = None


class ChangePasswordSerializer(serializers.Serializer):
Expand Down
Loading

0 comments on commit d310b64

Please sign in to comment.