diff options
Diffstat (limited to 'app/locations/models.py')
-rw-r--r-- | app/locations/models.py | 16 |
1 files changed, 16 insertions, 0 deletions
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() |