Merge branch 'master' of mowoe.com:reverend/lostplaces-backend into master
This commit is contained in:
commit
751d4c81fe
@ -29,7 +29,7 @@ class Voucher(models.Model):
|
|||||||
Creation date is being set automatically during voucher creation.
|
Creation date is being set automatically during voucher creation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
code = models.CharField(unique=True, max_length=10)
|
code = models.CharField(unique=True, max_length=30)
|
||||||
created = models.DateTimeField(auto_now_add=True)
|
created = models.DateTimeField(auto_now_add=True)
|
||||||
expires = models.DateField()
|
expires = models.DateField()
|
||||||
|
|
||||||
@ -63,10 +63,13 @@ class Place (models.Model):
|
|||||||
longitude = 0
|
longitude = 0
|
||||||
latitude = 0
|
latitude = 0
|
||||||
|
|
||||||
for place in place_list:
|
if amount > 0:
|
||||||
longitude += place.longitude
|
for place in place_list:
|
||||||
latitude += place.latitude
|
longitude += place.longitude
|
||||||
return (latitude / amount, longitude / amount)
|
latitude += place.latitude
|
||||||
|
return (latitude / amount, longitude / amount)
|
||||||
|
|
||||||
|
return (latitude, longitude)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
Loading…
Reference in New Issue
Block a user