Move all zephyr HTML generation to the client

(imported from commit 3afec768a5cd220c14ce615e03c29ee22754fdf2)
This commit is contained in:
Keegan McAllister
2012-08-30 13:56:15 -04:00
parent ddacce81b7
commit d57d19e562
4 changed files with 24 additions and 33 deletions

View File

@@ -76,6 +76,14 @@ class Zephyr(models.Model):
display_recipient = get_display_recipient(self.recipient)
return "<Zephyr: %s / %s / %r>" % (display_recipient, self.instance, self.sender)
def to_dict(self):
return {'id' : self.id,
'sender' : self.sender.user.username,
'type' : self.recipient.type,
'display_recipient': get_display_recipient(self.recipient),
'instance' : self.instance,
'content' : self.content }
def send_zephyr(**kwargs):
zephyr = kwargs["instance"]
if zephyr.recipient.type == "personal":