mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-01 19:25:17 +02:00
GEO Point checker!
This commit is contained in:
parent
283431085f
commit
45196f9823
11 changed files with 129 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.contrib.gis.db import models as gis_models
|
||||
|
||||
|
||||
User = get_user_model()
|
||||
|
@ -34,6 +35,7 @@ class Country(models.Model):
|
|||
choices=CONTINENT_CHOICES,
|
||||
default=AFRICA
|
||||
)
|
||||
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Country"
|
||||
|
@ -47,6 +49,7 @@ class Region(models.Model):
|
|||
name = models.CharField(max_length=100)
|
||||
name_en = models.CharField(max_length=100, blank=True, null=True)
|
||||
country = models.ForeignKey(Country, on_delete=models.CASCADE)
|
||||
geometry = gis_models.MultiPolygonField(srid=4326, null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue