Skip to content
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

Annotation Endpoints #12

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ maintenance. To non-destructively update your development stack at any time:
2. Run `docker compose build --pull --no-cache`
3. Run `docker compose run --rm django ./manage.py migrate`
3. Run `docker compose run --rm django ./manage.py createsuperuser`
4. Run `docker compose run --rm django ./manage.py makeclient --username [email protected] --uri http://localhost:3000/`
4. Run `docker compose run --rm django ./manage.py loaddata species` to load species data into the database
5. Run `docker compose run --rm django ./manage.py makeclient --username [email protected] --uri http://localhost:3000/`
## Develop Natively (advanced)
This configuration still uses Docker to run attached services in the background,
but allows developers to run Python code on their native system.
Expand Down
3 changes: 2 additions & 1 deletion bats_ai/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ninja.security import HttpBearer
from oauth2_provider.models import AccessToken

from bats_ai.core.views import RecordingRouter
from bats_ai.core.views import RecordingRouter, SpeciesRouter

logger = logging.getLogger(__name__)

Expand All @@ -22,3 +22,4 @@ def authenticate(self, request, token):
api = NinjaAPI()

api.add_router('/recording/', RecordingRouter)
api.add_router('/species/', SpeciesRouter)
2 changes: 2 additions & 0 deletions bats_ai/core/admin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from .annotations import AnnotationsAdmin
from .image import ImageAdmin
from .recording import RecordingAdmin

__all__ = [
'ImageAdmin',
'RecordingAdmin',
'AnnotationsAdmin',
]
21 changes: 21 additions & 0 deletions bats_ai/core/admin/annotations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from django.contrib import admin

from bats_ai.core.models import Annotations


@admin.register(Annotations)
class AnnotationsAdmin(admin.ModelAdmin):
list_display = [
'pk',
'recording',
'owner',
'start_time',
'end_time',
'low_freq',
'high_freq',
'comments',
]
list_select_related = True
# list_select_related = ['owner']
filter_horizontal = ('species',) # or filter_vertical
autocomplete_fields = ['owner']
Loading
Loading