-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* temporal annotation models and endpoints * migrations for temporal endpoints * updating migrations * basics of rendering temporal annotations * linting * temporal creation/editing/deletion * supporting multiple users with sequence and pulse annotations * client cleanup of minor issues
- Loading branch information
1 parent
ce43eb8
commit ebcebcf
Showing
30 changed files
with
1,517 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
from .annotations import AnnotationsAdmin | ||
from .image import ImageAdmin | ||
from .recording import RecordingAdmin | ||
from .species import SpeciesAdmin | ||
from .spectrogram import SpectrogramAdmin | ||
from .temporal_annotations import TemporalAnnotationsAdmin | ||
|
||
__all__ = [ | ||
'AnnotationsAdmin', | ||
'ImageAdmin', | ||
'RecordingAdmin', | ||
'SpectrogramAdmin', | ||
'TemporalAnnotationsAdmin', | ||
'SpeciesAdmin', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django.contrib import admin | ||
|
||
from bats_ai.core.models import Species | ||
|
||
|
||
@admin.register(Species) | ||
class SpeciesAdmin(admin.ModelAdmin): | ||
list_display = [ | ||
'pk', | ||
'species_code', | ||
'family', | ||
'genus', | ||
'species', | ||
'common_name', | ||
'species_code_6', | ||
] | ||
list_select_related = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from django.contrib import admin | ||
|
||
from bats_ai.core.models import TemporalAnnotations | ||
|
||
|
||
@admin.register(TemporalAnnotations) | ||
class TemporalAnnotationsAdmin(admin.ModelAdmin): | ||
list_display = [ | ||
'pk', | ||
'recording', | ||
'owner', | ||
'start_time', | ||
'end_time', | ||
'type', | ||
'comments', | ||
] | ||
list_select_related = True | ||
autocomplete_fields = ['owner'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Generated by Django 4.1.13 on 2024-02-15 18:08 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('core', '0006_alter_recording_recording_location'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='TemporalAnnotations', | ||
fields=[ | ||
( | ||
'id', | ||
models.BigAutoField( | ||
auto_created=True, primary_key=True, serialize=False, verbose_name='ID' | ||
), | ||
), | ||
('start_time', models.IntegerField(blank=True, null=True)), | ||
('end_time', models.IntegerField(blank=True, null=True)), | ||
('type', models.TextField(blank=True, null=True)), | ||
('comments', models.TextField(blank=True, null=True)), | ||
( | ||
'owner', | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL | ||
), | ||
), | ||
( | ||
'recording', | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, to='core.recording' | ||
), | ||
), | ||
('species', models.ManyToManyField(to='core.species')), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django.contrib.auth.models import User | ||
from django.db import models | ||
|
||
from .recording import Recording | ||
from .species import Species | ||
|
||
|
||
class TemporalAnnotations(models.Model): | ||
recording = models.ForeignKey(Recording, on_delete=models.CASCADE) | ||
owner = models.ForeignKey(User, on_delete=models.CASCADE) | ||
start_time = models.IntegerField(blank=True, null=True) | ||
end_time = models.IntegerField(blank=True, null=True) | ||
type = models.TextField(blank=True, null=True) | ||
comments = models.TextField(blank=True, null=True) | ||
species = models.ManyToManyField(Species) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
from .annotations import router as AnnotationRouter | ||
from .recording import router as RecordingRouter | ||
from .species import router as SpeciesRouter | ||
from .temporal_annotations import router as TemporalAnnotationRouter | ||
|
||
__all__ = [ | ||
'RecordingRouter', | ||
'SpeciesRouter', | ||
'AnnotationRouter', | ||
'TemporalAnnotationRouter', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.