Пример #1
0
 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)
Пример #2
0
 def save(self, *args, **kwargs):
     unique_slugify(self, self.name)
     super(Category, self).save(*args, **kwargs)
Пример #3
0
 def save(self):
     unique_slugify(self, self.name)
     super(App, self).save()
Пример #4
0
 def save(self, *args, **kwargs):
     unique_slugify(self, self.title)
     self.summary = truncatewords_html(self.content, 40)
     super(Post, self).save(*args, **kwargs)
Пример #5
0
 def save(self, *args, **kwargs):
     slugs.unique_slugify(self, self.title)
     super(Post, self).save(*args, **kwargs)
Пример #6
0
 def save(self, *args, **kwargs):
     unique_slugify(self, self.title)
     super(Page, self).save(*args, **kwargs)
Пример #7
0
 def save(self, *args, **kwargs):
     slugs.unique_slugify(self, self.title)
     super(Post, self).save(*args, **kwargs)
Пример #8
0
 def save(self):
     unique_slugify(self, self.name)
     super(App, self).save()
Пример #9
0
 def save(self):
     unique_slugify(self, self.title)
     super(Photo, self).save()
Пример #10
0
 def save(self):
     unique_slugify(self, self.title)
     super(Album, self).save()