-
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.
Fixes & features for higher taxon ranks (#496)
* Update admin to use new parents_json * Add tests for parents_json & recursive counts * Default taxon parents to list, update django-pydantic-fields * Use real TaxonRank objects everywhere except API responses * Show all occurrences under a taxon parent * Placeholder hack to include a recursive occurrence count for detail views * Give up on add all occurrence counts in one query for now * Link to occurrences list in species detail modal, even if occurrences count not available
- Loading branch information
Showing
9 changed files
with
330 additions
and
41 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
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
46 changes: 46 additions & 0 deletions
46
ami/main/migrations/0035_alter_taxon_parents_json_alter_taxon_rank.py
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,46 @@ | ||
# Generated by Django 4.2.10 on 2024-08-06 17:47 | ||
|
||
import ami.main.models | ||
from django.db import migrations, models | ||
import django_pydantic_field._migration_serializers | ||
import django_pydantic_field.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("main", "0034_remove_taxon_parents_taxon_parents_json"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="taxon", | ||
name="parents_json", | ||
field=django_pydantic_field.fields.PydanticSchemaField( | ||
blank=True, | ||
config=None, | ||
default=list, | ||
schema=django_pydantic_field._migration_serializers.GenericContainer( | ||
list, (ami.main.models.TaxonParent,) | ||
), | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="taxon", | ||
name="rank", | ||
field=models.CharField( | ||
choices=[ | ||
("ORDER", "ORDER"), | ||
("SUPERFAMILY", "SUPERFAMILY"), | ||
("FAMILY", "FAMILY"), | ||
("SUBFAMILY", "SUBFAMILY"), | ||
("TRIBE", "TRIBE"), | ||
("SUBTRIBE", "SUBTRIBE"), | ||
("GENUS", "GENUS"), | ||
("SPECIES", "SPECIES"), | ||
("UNKNOWN", "UNKNOWN"), | ||
], | ||
default="SPECIES", | ||
max_length=255, | ||
), | ||
), | ||
] |
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.