-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add stubs for observed taxa views & serializer
- Loading branch information
Showing
3 changed files
with
37 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from ami.base.serializers import DefaultSerializer | ||
from ami.taxa.models import TaxonObserved | ||
|
||
|
||
class TaxonObservedSerializer(DefaultSerializer): | ||
class Meta: | ||
model = TaxonObserved | ||
fields = [ | ||
"id", | ||
"taxon", | ||
"project", | ||
"detections_count", | ||
"occurrences_count", | ||
"best_detection", | ||
"best_determination_score", | ||
"last_detected", | ||
"created_at", | ||
"updated_at", | ||
] |
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 +1,16 @@ | ||
# Create your views here. | ||
import logging | ||
|
||
from ami.main.api.views import DefaultViewSet | ||
from ami.taxa.models import TaxonObserved | ||
from ami.taxa.serializers import TaxonObservedSerializer | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class TaxonObservedViewSet(DefaultViewSet): | ||
""" | ||
Endpoint for taxa information that have been observed in a project. | ||
""" | ||
|
||
queryset = TaxonObserved.objects.all() | ||
serializer_class = TaxonObservedSerializer |
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