From 38b863f790eecdc328bd43589bca3630e46be73e Mon Sep 17 00:00:00 2001 From: sng Date: Tue, 28 May 2013 19:58:08 -0400 Subject: bug fixes for links in main menu --- app/locations/models.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'app') diff --git a/app/locations/models.py b/app/locations/models.py index e088697..6fc85cf 100644 --- a/app/locations/models.py +++ b/app/locations/models.py @@ -159,6 +159,22 @@ class Location(models.Model): def __unicode__(self): return self.name +class BirdingLocation(models.Model): + location = models.ForeignKey(Location) + name = models.CharField(max_length=50) + slug = models.SlugField() + date_visited = models.DateTimeField('Date visited',null=True) + point = models.PointField() + # GeoManager, a subclass that adds a rich set of geospatial queryset methods + objects = models.GeoManager() + + def get_absolute_url(self): + return "/birdinglocations/%s/%s/%s/" % (self.state.country.slug, self.state.slug, self.slug) + + + def __unicode__(self): return self.name + + class Route(models.Model): name = models.CharField(max_length=200) slug = models.SlugField() -- cgit v1.2.3-70-g09d2