Mercurial > public > sg101
diff gpp/messages/models.py @ 128:48621ba5c385
Fixing #36, Smilify doesn't work when a smiley appears first before other text. Refactored the smiley system to produce markdown as well as HTML.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 20 Nov 2009 01:43:32 +0000 |
parents | 9c18250972d5 |
children | 5c889b587416 |
line wrap: on
line diff
--- a/gpp/messages/models.py Mon Nov 16 01:00:28 2009 +0000 +++ b/gpp/messages/models.py Fri Nov 20 01:43:32 2009 +0000 @@ -1,11 +1,12 @@ """Models for the messages application.""" import datetime + from django.db import models from django.db.models import Q from django.contrib.auth.models import User -from core.markup import markdown -from smiley import smilify + +from core.markup import site_markup class MessageManager(models.Manager): @@ -63,7 +64,7 @@ def save(self, force_insert = False, force_update = False): if not self.id: self.send_date = datetime.datetime.now() - self.html = smilify(markdown(self.message)) + self.html = site_markup(self.message) super(Message, self).save(force_insert, force_update) @models.permalink