diff gpp/membermap/models.py @ 153:13d052fbe4f1

Fixing #28, cosmetic issues with member map. Also fixed a bug involving the smiley and markdown interactions. Single quotes were getting HTML REMOVED by markdown.
author Brian Neal <bgneal@gmail.com>
date Sat, 19 Dec 2009 19:34:16 +0000
parents dbd703f7d63a
children 5c889b587416
line wrap: on
line diff
--- a/gpp/membermap/models.py	Sat Dec 19 04:59:06 2009 +0000
+++ b/gpp/membermap/models.py	Sat Dec 19 19:34:16 2009 +0000
@@ -7,8 +7,9 @@
 from django.template.defaultfilters import escapejs
 import django.utils.simplejson as json
 
+from core.markup import site_markup
 
-# Create your models here.
+
 class MapEntry(models.Model):
     """Represents a user's entry on the map."""
     user = models.ForeignKey(User)
@@ -27,7 +28,10 @@
         verbose_name_plural = 'map entries'
 
     def save(self, force_insert=False, force_update=False):
-        msg = render_to_string('membermap/markdown.html', {'entry': self}).strip()
+        msg = render_to_string('membermap/markdown.html', {
+            'user': self.user,
+            'msg': site_markup(self.message)}).strip()
+
         self.json = json.dumps({'name': self.user.username,
             'lat': '%10.6f' % self.lat,
             'lon': '%10.6f' % self.lon,
@@ -35,4 +39,3 @@
             })
         super(MapEntry, self).save(force_insert, force_update)
 
-# vim: ts=4 sw=4