ebird-api-data 0.3.5__tar.gz → 0.3.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/PKG-INFO +1 -1
  2. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/pyproject.toml +2 -2
  3. ebird_api_data-0.3.7/src/ebird/api/data/__init__.py +1 -0
  4. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/admin.py +0 -13
  5. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/loaders.py +0 -3
  6. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/models/checklist.py +11 -30
  7. ebird_api_data-0.3.5/src/ebird/api/data/__init__.py +0 -1
  8. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/.gitignore +0 -0
  9. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/LICENSE +0 -0
  10. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/README.md +0 -0
  11. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/apps.py +0 -0
  12. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/fields.py +0 -0
  13. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/locale/en/LC_MESSAGES/django.mo +0 -0
  14. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/locale/en/LC_MESSAGES/django.po +0 -0
  15. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/management/__init__.py +0 -0
  16. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/management/commands/__init__.py +0 -0
  17. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/management/commands/add_checklists.py +0 -0
  18. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/migrations/0001_initial.py +0 -0
  19. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/migrations/__init__.py +0 -0
  20. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/models/__init__.py +0 -0
  21. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/models/country.py +0 -0
  22. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/models/county.py +0 -0
  23. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/models/filter.py +0 -0
  24. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/models/location.py +0 -0
  25. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/models/observation.py +0 -0
  26. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/models/observer.py +0 -0
  27. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/models/species.py +0 -0
  28. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/models/state.py +0 -0
  29. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/templates/admin/data/species/change_list_object_tools.html +0 -0
  30. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/templates/admin/data/species/fetch_species.html +0 -0
  31. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/templates/data/widgets/translation_field.html +0 -0
  32. {ebird_api_data-0.3.5 → ebird_api_data-0.3.7}/src/ebird/api/data/widgets.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ebird-api-data
3
- Version: 0.3.5
3
+ Version: 0.3.7
4
4
  Summary: eBird API Data is a reusable Django app for loading data from eBird into a database.
5
5
  Author-email: Stuart MacKay <smackay@flagstonesoftware.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ebird-api-data"
3
- version = "0.3.5"
3
+ version = "0.3.7"
4
4
  description = "eBird API Data is a reusable Django app for loading data from eBird into a database."
5
5
  keywords = ["checklists", "observations", "species", "Django", "eBird", "models"]
6
6
  license = "MIT"
@@ -65,7 +65,7 @@ dev-dependencies = [
65
65
  ]
66
66
 
67
67
  [tool.bumpversion]
68
- current_version = "0.3.5"
68
+ current_version = "0.3.7"
69
69
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
70
70
  serialize = ["{major}.{minor}.{patch}"]
71
71
  ignore_missing_version = false
@@ -0,0 +1 @@
1
+ __version__ = "0.3.7"
@@ -44,18 +44,6 @@ class ObservationInline(admin.TabularInline):
44
44
  .order_by("species__taxon_order")
45
45
  )
46
46
 
47
- class ProtocolListFilter(admin.SimpleListFilter):
48
- title = _("protocol")
49
- parameter_name = "protocol_code"
50
-
51
- def lookups(self, request, model_admin):
52
- return [(key, value) for key, value in Checklist.Protocol.NAMES.items()]
53
-
54
- def queryset(self, request, queryset):
55
- if value := self.value():
56
- return queryset.filter(protocol_code=value)
57
-
58
-
59
47
  @admin.register(models.Checklist)
60
48
  class ChecklistAdmin(admin.ModelAdmin):
61
49
  list_display = (
@@ -66,7 +54,6 @@ class ChecklistAdmin(admin.ModelAdmin):
66
54
  "location",
67
55
  "observer",
68
56
  )
69
- list_filter = [ProtocolListFilter]
70
57
  ordering = ("-started",)
71
58
  search_fields = ("identifier", "location__name", "observer__name")
72
59
  autocomplete_fields = ("location", "observer")
@@ -396,9 +396,6 @@ class APILoader:
396
396
  if area := data.get("effortAreaHa"):
397
397
  values["area"] = round(Decimal(area), 3)
398
398
 
399
- if data["protocolId"] not in Checklist.Protocol.NAMES.keys():
400
- logger.info("New protocol: %s", data["protocolId"])
401
-
402
399
  if "comments" in data:
403
400
  values["comments"] = data["comments"]
404
401
 
@@ -1,32 +1,19 @@
1
+ from enum import StrEnum
2
+
1
3
  from django.db import models
2
4
  from django.utils.translation import gettext_lazy as _
3
5
 
4
6
 
5
7
  class Checklist(models.Model):
6
- class Protocol:
7
- INCIDENTAL = "P20" # Birding is not the primary purpose
8
- STATIONARY = "P21" # Move less than 30m (100ft)
9
- TRAVELING = "P22" # Move more than 30m (100ft)
10
- AREA = "P23" # Complete coverage of an area
11
- BANDING = "P33" # Banding/ringing
12
- NOCTURNAL = "P54" # Nocturnal Flight Call Count
13
- PELAGIC = "P60" # Birding from a boat, 2+ miles from land
14
- HISTORICAL = "P62" # Start time, duration or distance not known
15
- COMMON_BIRD_SURVEY = "P67" # Stationary, two-band: <25m, >25m
16
- DIRECTIONAL = "P68" # Stationary, note cardinal direction: N, S, E, W
17
-
18
- NAMES = {
19
- INCIDENTAL: _("Incidental"),
20
- STATIONARY: _("Stationary"),
21
- TRAVELING: _("Traveling"),
22
- AREA: _("Area"),
23
- BANDING: _("Banding"),
24
- NOCTURNAL: _("Nocturnal Flight Call Count"),
25
- PELAGIC: _("Pelagic"),
26
- HISTORICAL: _("Historical"),
27
- COMMON_BIRD_SURVEY: _("Common Bird Survey"),
28
- DIRECTIONAL: _("Stationary (directional)"),
29
- }
8
+ class Protocol(StrEnum):
9
+ INCIDENTAL = "P20"
10
+ STATIONARY = "P21"
11
+ TRAVELING = "P22"
12
+ AREA = "P23"
13
+ BANDING = "P33"
14
+ NOCTURNAL = "P54"
15
+ PELAGIC = "P60"
16
+ HISTORICAL = "P62"
30
17
 
31
18
  class Meta:
32
19
  verbose_name = _("checklist")
@@ -141,9 +128,6 @@ class Checklist(models.Model):
141
128
  help_text=_("The code used to identify the protocol."),
142
129
  )
143
130
 
144
- # Protocol is not used to set the choices, as we still want to load
145
- # the checklist when a protocol not defined in the class is used.
146
-
147
131
  project_code = models.TextField(
148
132
  blank=True,
149
133
  verbose_name=_("project code"),
@@ -213,6 +197,3 @@ class Checklist(models.Model):
213
197
 
214
198
  def __str__(self) -> str:
215
199
  return str(self.identifier)
216
-
217
- def get_protocol(self):
218
- return self.Protocol.NAMES.get(self.protocol_code, "")
@@ -1 +0,0 @@
1
- __version__ = "0.3.5"
File without changes
File without changes