From 0e4f3e61bd808330784f0b9646725ae005a67465 Mon Sep 17 00:00:00 2001 From: Bryon Lewis Date: Fri, 5 Jan 2024 15:39:21 -0500 Subject: [PATCH] linting --- bats_ai/core/fixtures/species.json | 2 +- bats_ai/core/migrations/0003_annotations.py | 22 +++++++++++++++++---- bats_ai/core/views/species.py | 10 +--------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/bats_ai/core/fixtures/species.json b/bats_ai/core/fixtures/species.json index be99963..53f0208 100644 --- a/bats_ai/core/fixtures/species.json +++ b/bats_ai/core/fixtures/species.json @@ -1007,4 +1007,4 @@ "species_code_6": "NYCSPP" } } -] \ No newline at end of file +] diff --git a/bats_ai/core/migrations/0003_annotations.py b/bats_ai/core/migrations/0003_annotations.py index 0ca374d..edb65c4 100644 --- a/bats_ai/core/migrations/0003_annotations.py +++ b/bats_ai/core/migrations/0003_annotations.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('core', '0002_species'), @@ -16,14 +15,29 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Annotations', fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ( + '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)), ('low_freq', models.IntegerField(blank=True, null=True)), ('high_freq', models.IntegerField(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')), + ( + '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')), ], ), diff --git a/bats_ai/core/views/species.py b/bats_ai/core/views/species.py index f6db398..fe0bae1 100644 --- a/bats_ai/core/views/species.py +++ b/bats_ai/core/views/species.py @@ -1,14 +1,8 @@ -from datetime import datetime import logging -from django.contrib.auth.models import User -from django.core.files.storage import default_storage from django.http import HttpRequest -from ninja import File, Form, Schema -from ninja.errors import HttpError -from ninja.files import UploadedFile +from ninja import Schema from ninja.pagination import RouterPaginated -from oauth2_provider.models import AccessToken from bats_ai.core.models import Species @@ -27,8 +21,6 @@ class SpeciesSchema(Schema): species_code_6: str | None - - @router.get('/') def get_species(request: HttpRequest): species = Species.objects.values()