Skip to content

Commit

Permalink
Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
norkans7 committed Jan 10, 2025
1 parent 9846017 commit bfd6c9b
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions temba/locations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@
from django.db.models.functions import Concat, Lower, Upper


# default manager for AdminBoundary, doesn't load geometries
class NoGeometryManager(models.Manager):
def get_queryset(self):
return super().get_queryset().defer("simplified_geometry")


# optional 'geometries' manager for AdminBoundary, loads everything
class GeometryManager(models.Manager):
def get_queryset(self):
return super().get_queryset()


class AdminBoundary(MPTTModel, models.Model):
"""
Represents a single administrative boundary (like a country, state or district)
Expand All @@ -43,19 +31,6 @@ class AdminBoundary(MPTTModel, models.Model):
path = models.CharField(max_length=768) # e.g. Rwanda > Kigali
simplified_geometry = models.MultiPolygonField(null=True)

objects = NoGeometryManager()
geometries = GeometryManager()

def release(self):
for child_boundary in AdminBoundary.objects.filter(parent=self): # pragma: no cover
child_boundary.release()

self.aliases.all().delete()
self.delete()

def __str__(self):
return self.name

class Meta:
indexes = [models.Index(Upper("name"), name="adminboundaries_by_name")]

Expand Down

0 comments on commit bfd6c9b

Please sign in to comment.