Allow empty for lat/long
This commit is contained in:
parent
782f27f53d
commit
e7bc8b8952
1 changed files with 7 additions and 2 deletions
|
@ -76,6 +76,11 @@ class RangeType(models.Model):
|
|||
return self.range_type
|
||||
|
||||
|
||||
def allow_empty(value):
|
||||
if value is None or value == "":
|
||||
return 0
|
||||
|
||||
|
||||
class MountainRange(models.Model):
|
||||
MAP_UNIT_CHOICES = (
|
||||
('Aggregated', 'Aggregated'),
|
||||
|
@ -100,8 +105,8 @@ class MountainRange(models.Model):
|
|||
level_1 = models.TextField(blank=True, null=True)
|
||||
level_2 = models.TextField(blank=True, null=True)
|
||||
level_3 = models.TextField(blank=True, null=True)
|
||||
latitude = models.DecimalField(max_digits=22, decimal_places=16, blank=True, null=True)
|
||||
longitude = models.DecimalField(max_digits=22, decimal_places=16, blank=True, null=True)
|
||||
latitude = models.DecimalField(max_digits=22, decimal_places=16, blank=True, null=True, default=0, validators =[allow_empty])
|
||||
longitude = models.DecimalField(max_digits=22, decimal_places=16, blank=True, null=True, default=0, validators =[allow_empty])
|
||||
orogeny = models.TextField(blank=True, null=True)
|
||||
area = models.FloatField(blank=True, null=True)
|
||||
GMBA_v1_id = models.CharField(blank=True, null=True, max_length=25)
|
||||
|
|
Loading…
Reference in a new issue