def save(self, *args, **kwargs): unique_slugify(self, self.name) location = self.name location = urllib.quote_plus(location) # Use google API to get silly stuff back google_feed = 'http://maps.googleapis.com/maps/api/geocode/json?address=' + location + '&sensor=false' map_data = urllib.urlopen(google_feed) map_json = map_data.read() map_object = simplejson.loads(map_json) result_object = map_object['results'] location = result_object[0]['geometry'] geos = location['location'] self.latitude = geos['lat'] self.longitude = geos['lng'] super(Country, self).save(*args, **kwargs)
def save(self, *args, **kwargs): unique_slugify(self, self.name) super(Category, self).save(*args, **kwargs)
def save(self): unique_slugify(self, self.name) super(App, self).save()
def save(self, *args, **kwargs): unique_slugify(self, self.title) self.summary = truncatewords_html(self.content, 40) super(Post, self).save(*args, **kwargs)
def save(self, *args, **kwargs): slugs.unique_slugify(self, self.title) super(Post, self).save(*args, **kwargs)
def save(self, *args, **kwargs): unique_slugify(self, self.title) super(Page, self).save(*args, **kwargs)
def save(self): unique_slugify(self, self.title) super(Photo, self).save()
def save(self): unique_slugify(self, self.title) super(Album, self).save()