-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source config endpoint #692
Source config endpoint #692
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Just a couple small naming things. We follow the PEP 8 style guide which specifies naming conventions for function and class names among other things.
There are Atom linters that will highlight unconventional syntax/formatting in the editor. flake8 is just a wrapper around PEP8 and is part of our test suite. Linters are super helpful and I would recommend installing one 💯
api/views/__init__.py
Outdated
@@ -5,3 +5,4 @@ | |||
from .registration import * # noqa | |||
from .schema import * # noqa | |||
from .banner import * # noqa | |||
from .sourceConfig import * # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny changes:
sourceConfig
-->source_config
- two space before the comment
api/urls.py
Outdated
@@ -86,6 +86,7 @@ def register_url(self, subclass, viewset): | |||
register_route(r'rawdata', views.RawDatumViewSet) | |||
register_route(r'user', views.ShareUserViewSet) | |||
register_route(r'sources', views.SourceViewSet) | |||
register_route(r'sourceConfig', views.SourceConfigViewSet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sourceConfig
--> source_config
api/views/sourceConfig.py
Outdated
class SourceConfigViewSet(viewsets.ReadOnlyModelViewSet): | ||
serializer_class = SourceConfigSerializer | ||
|
||
def get_queryset(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there isn't any special logic, we can just define queryset
instead of overriding the get_queryset
function. See the last example in DRF ViewSet example section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the file should be renamed 👍
… into SourceConfig-endpoint * 'develop' of https://github.com/CenterForOpenScience/SHARE: [Fix] Correct harvester scheduling [SHARE-924][Fix] Make RawDataJanitor actually feasible [Fix] Don't use Django's delete
This PR will be included in #700, thank you! |
Creation of SourceConfig endpoint