Skip to content

Commit

Permalink
Merge pull request #12 from Kitware/annotation-endpoints
Browse files Browse the repository at this point in the history
Annotation Endpoints
  • Loading branch information
BryonLewis authored Jan 8, 2024
2 parents f17bef2 + 823c54d commit 505001f
Show file tree
Hide file tree
Showing 16 changed files with 1,415 additions and 98 deletions.
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

0 comments on commit 505001f

Please sign in to comment.