|
@@ -1,5 +1,6 @@
|
|
|
from django.contrib.contenttypes.fields import GenericRelation
|
|
from django.contrib.contenttypes.fields import GenericRelation
|
|
|
from django.core.exceptions import ValidationError
|
|
from django.core.exceptions import ValidationError
|
|
|
|
|
+from django.core.validators import MaxValueValidator, MinValueValidator
|
|
|
from django.db import models
|
|
from django.db import models
|
|
|
from django.utils.translation import gettext_lazy as _
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
from timezone_field import TimeZoneField
|
|
from timezone_field import TimeZoneField
|
|
@@ -210,6 +211,7 @@ class Site(ContactsMixin, ImageAttachmentsMixin, PrimaryModel):
|
|
|
decimal_places=6,
|
|
decimal_places=6,
|
|
|
blank=True,
|
|
blank=True,
|
|
|
null=True,
|
|
null=True,
|
|
|
|
|
+ validators=[MinValueValidator(-90.0), MaxValueValidator(90.0)],
|
|
|
help_text=_('GPS coordinate in decimal format (xx.yyyyyy)')
|
|
help_text=_('GPS coordinate in decimal format (xx.yyyyyy)')
|
|
|
)
|
|
)
|
|
|
longitude = models.DecimalField(
|
|
longitude = models.DecimalField(
|
|
@@ -218,6 +220,7 @@ class Site(ContactsMixin, ImageAttachmentsMixin, PrimaryModel):
|
|
|
decimal_places=6,
|
|
decimal_places=6,
|
|
|
blank=True,
|
|
blank=True,
|
|
|
null=True,
|
|
null=True,
|
|
|
|
|
+ validators=[MinValueValidator(-180.0), MaxValueValidator(180.0)],
|
|
|
help_text=_('GPS coordinate in decimal format (xx.yyyyyy)')
|
|
help_text=_('GPS coordinate in decimal format (xx.yyyyyy)')
|
|
|
)
|
|
)
|
|
|
|
|
|