File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3- from .annotations import router as annotation_router
43from .configuration import router as configuration_router
54from .export_annotation import router as export_annotation_router
65from .grts_cells import router as grts_cells_router
98from .recording import router as recording_router
109from .recording_annotation import router as recording_annotation_router
1110from .recording_tag import router as recording_tag_router
12- from .sequence_annotations import router as sequence_annotation_router
1311from .species import router as species_router
1412from .vetting_details import router as vetting_router
1513
1614__all__ = [
17- "annotation_router" ,
1815 "configuration_router" ,
1916 "export_annotation_router" ,
2017 "grts_cells_router" ,
2320 "recording_annotation_router" ,
2421 "recording_router" ,
2522 "recording_tag_router" ,
26- "sequence_annotation_router" ,
2723 "species_router" ,
2824 "vetting_router" ,
2925]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2525 Spectrogram ,
2626)
2727from bats_ai .core .tasks .tasks import recording_compute_spectrogram
28- from bats_ai .core .views .sequence_annotations import (
29- SequenceAnnotationSchema ,
30- UpdateSequenceAnnotationSchema ,
31- )
3228from bats_ai .core .views .species import SpeciesSchema
3329
3430if TYPE_CHECKING :
@@ -272,6 +268,35 @@ def linestring_to_list(ls):
272268 )
273269
274270
271+ class SequenceAnnotationSchema (Schema ):
272+ id : int
273+ start_time : int
274+ end_time : int
275+ type : str | None
276+ comments : str
277+ species : list [SpeciesSchema ] | None
278+ owner_email : str = None
279+
280+ @classmethod
281+ def from_orm (cls , obj , owner_email = None ):
282+ return cls (
283+ start_time = obj .start_time ,
284+ end_time = obj .end_time ,
285+ type = obj .type ,
286+ species = [SpeciesSchema .from_orm (species ) for species in obj .species .all ()],
287+ comments = obj .comments ,
288+ id = obj .id ,
289+ owner_email = owner_email , # Include owner_email in the schema
290+ )
291+
292+
293+ class UpdateSequenceAnnotationSchema (Schema ):
294+ start_time : int = None
295+ end_time : int = None
296+ type : str | None = None
297+ comments : str | None = None
298+
299+
275300@router .post ("/" )
276301def create_recording (
277302 request : HttpRequest ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments