-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from Mosquito-Alert/agg_speciesdistribution
Added aggregated stats in SpeciesDistribution
- Loading branch information
Showing
14 changed files
with
1,530 additions
and
145 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
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,5 @@ | ||
from django.db.models import Manager | ||
|
||
from .querysets import SpecieDistributionQuerySet | ||
|
||
SpecieDistributionManager = Manager.from_queryset(SpecieDistributionQuerySet) |
53 changes: 53 additions & 0 deletions
53
mosquito_alert/taxa/migrations/0007_historicalspeciedistribution_stats_summary_and_more.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,53 @@ | ||
# Generated by Django 4.2.3 on 2023-11-09 15:53 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django_jsonform.models.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("geo", "0002_alter_boundary_created_at_alter_boundary_updated_at_and_more"), | ||
("taxa", "0006_alter_taxon_gbif_id"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="historicalspeciedistribution", | ||
name="stats_summary", | ||
field=django_jsonform.models.fields.JSONField(blank=True, editable=False, null=True), | ||
), | ||
migrations.AddField( | ||
model_name="speciedistribution", | ||
name="stats_summary", | ||
field=django_jsonform.models.fields.JSONField(blank=True, editable=False, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name="historicalspeciedistribution", | ||
name="status", | ||
field=models.PositiveSmallIntegerField( | ||
blank=True, | ||
choices=[(0, "Absent"), (10, "Reported"), (20, "Introduced"), (30, "Established")], | ||
null=True, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="speciedistribution", | ||
name="boundary", | ||
field=models.ForeignKey( | ||
limit_choices_to={"numchild": 0}, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="+", | ||
to="geo.boundary", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="speciedistribution", | ||
name="status", | ||
field=models.PositiveSmallIntegerField( | ||
blank=True, | ||
choices=[(0, "Absent"), (10, "Reported"), (20, "Introduced"), (30, "Established")], | ||
null=True, | ||
), | ||
), | ||
] |
26 changes: 26 additions & 0 deletions
26
mosquito_alert/taxa/migrations/0008_speciedistribution_status_since_and_more.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,26 @@ | ||
# Generated by Django 4.2.3 on 2023-11-30 15:42 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.functions.datetime | ||
import django.utils.timezone | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("taxa", "0007_historicalspeciedistribution_stats_summary_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="speciedistribution", | ||
name="status_since", | ||
field=models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False), | ||
), | ||
migrations.AddConstraint( | ||
model_name="speciedistribution", | ||
constraint=models.CheckConstraint( | ||
check=models.Q(("status_since__lte", django.db.models.functions.datetime.Now())), | ||
name="status_since_cannot_be_future_dated", | ||
), | ||
), | ||
] |
Oops, something went wrong.