Mercurial > public > sg101
comparison gpp/membermap/models.py @ 182:5c889b587416
Fixing #64. Updating all model save() methods to use *args and **kwargs. Django 1.2 has new keyword arguments.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 28 Mar 2010 21:41:11 +0000 |
parents | 13d052fbe4f1 |
children | 4532ed27bed8 |
comparison
equal
deleted
inserted
replaced
181:500e5875a306 | 182:5c889b587416 |
---|---|
25 | 25 |
26 class Meta: | 26 class Meta: |
27 ordering = ('-date_updated', ) | 27 ordering = ('-date_updated', ) |
28 verbose_name_plural = 'map entries' | 28 verbose_name_plural = 'map entries' |
29 | 29 |
30 def save(self, force_insert=False, force_update=False): | 30 def save(self, *args, **kwargs): |
31 msg = render_to_string('membermap/markdown.html', { | 31 msg = render_to_string('membermap/markdown.html', { |
32 'user': self.user, | 32 'user': self.user, |
33 'msg': site_markup(self.message)}).strip() | 33 'msg': site_markup(self.message)}).strip() |
34 | 34 |
35 self.json = json.dumps({'name': self.user.username, | 35 self.json = json.dumps({'name': self.user.username, |
36 'lat': '%10.6f' % self.lat, | 36 'lat': '%10.6f' % self.lat, |
37 'lon': '%10.6f' % self.lon, | 37 'lon': '%10.6f' % self.lon, |
38 'message': msg, | 38 'message': msg, |
39 }) | 39 }) |
40 super(MapEntry, self).save(force_insert, force_update) | 40 super(MapEntry, self).save(*args, **kwargs) |
41 | 41 |