-
Notifications
You must be signed in to change notification settings - Fork 79
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
WIP: Add v1
data API
#1138
base: develop
Are you sure you want to change the base?
WIP: Add v1
data API
#1138
Conversation
OpenOversight/app/api/v1/api.py
Outdated
@v1.route("/departments/<int:department_id>/officers", methods=[HTTPMethod.GET]) | ||
def download_dept_officers(department_id: int): |
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.
Using one of the formats here: #385 (comment)
Thoughts, @sea-kelp @abandoned-prototype @b-meson @AetherUnbound?
OpenOversight/app/main/__init__.py
Outdated
from flask import Blueprint | ||
|
||
|
||
main = Blueprint("main", __name__) | ||
|
||
from OpenOversight.app.main import views # noqa: E402,F401 |
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.
Moved this to ./main/views.py
.
OpenOversight/app/auth/__init__.py
Outdated
from flask import Blueprint | ||
|
||
|
||
auth = Blueprint("auth", __name__) | ||
|
||
from . import views # noqa: E402,F401 |
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.
Moved this to ./auth/views.py
.
This reverts commit 013f4bb.
@@ -136,23 +175,14 @@ class Department(BaseModel, TrackUpdates): | |||
__table_args__ = (UniqueConstraint("name", "state", name="departments_name_state"),) | |||
|
|||
def __repr__(self): | |||
return f"<Department ID {self.id}: {self.name} {self.state}>" | |||
|
|||
def to_custom_dict(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.
This isn't needed anymore with the addition of the Serializable
class.
## Description of Changes Addressed inconsistencies with the model `__repr__` functions. Mostly making this because this PR got a bit out of control: #1138 ## Tests and Linting - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
## Fixes issue Sets the groundwork for this issue: #385 ## Description of Changes Simplifying the import logic for the `auth` and `main` routes of the application. This also sets up the work for this PR: #1138 ## Tests and Linting - [x] This branch is up-to-date with the `develop` branch. - [x] `pytest` passes on my local development environment. - [x] `pre-commit` passes on my local development environment.
Fixes issue
#385
Description of Changes
Add the baseline features for a data-focused API.
Tests and Linting
develop
branch.pytest
passes on my local development environment.pre-commit
passes on my local development environment.