A plethora of fixes to make this more usable on non-mobile devices; should gracefully degrade a bit better now... if it can't get any GPS coordinates, the user can enter an address and bypass that requirement, and we'll do a reverse lookup and get some GPS coordinates based on said address. Users can also now view the checkin history of other people - someone wanna implement friendships/privacy? We have an open source 4Square here. ;D

This commit is contained in:
Ryan McGrath 2010-10-29 05:10:41 -04:00
parent c17458cc8a
commit d503e3fe08
11 changed files with 223 additions and 116 deletions

View file

@ -23,7 +23,7 @@ class Location(models.Model):
name = models.CharField(max_length=200)
street_address = models.CharField(max_length=200, blank=True)
category = models.ForeignKey(LocationCategory, blank=True, null=True)
geometry = models.PointField(srid=4326)
geometry = models.PointField(srid=4326, blank=True, null=True)
objects = models.GeoManager()
def __str__(self):
@ -33,7 +33,6 @@ class Location(models.Model):
"""
Tally up how many checkins this location had in the past day.
"""
print self.checkin_set.filter(timestamp__gte = datetime.now() + timedelta(days=-1))
return self.checkin_set.filter(timestamp__gte = datetime.now() + timedelta(days=-1)).count()
def address_for_geocode(self):