Source config endpoint#692
Source config endpoint#692Oludare96 wants to merge 4 commits intoCenterForOpenScience:developfrom Oludare96:SourceConfig-endpoint
Conversation
There was a problem hiding this comment.
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
| from .registration import * # noqa | ||
| from .schema import * # noqa | ||
| from .banner import * # noqa | ||
| from .sourceConfig import * # noqa |
There was a problem hiding this comment.
Tiny changes:
sourceConfig-->source_config- two space before the comment
api/urls.py
Outdated
| 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.
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.
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.
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