From 3db8dd7d9328e38fbc8eacf0f7553778bc31d94f Mon Sep 17 00:00:00 2001 From: Aamir Khan Date: Thu, 5 Jul 2012 11:53:09 -0400 Subject: Display message snippet on user profile page --- models.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'models.py') diff --git a/models.py b/models.py index 0193705..da28552 100644 --- a/models.py +++ b/models.py @@ -1,7 +1,13 @@ from django.db import models from django.contrib.auth.models import User +from django.conf import settings + +from kittystore.kittysastore import KittySAStore + from gsoc.utils import log +STORE = KittySAStore(settings.KITTYSTORE_URL) + class Rating(models.Model): # @TODO: instead of list_address, user list model from kittystore? @@ -36,6 +42,11 @@ class UserProfile(models.Model): except Rating.DoesNotExist: votes = {} + for vote in votes: + list_name = vote.list_address.split('@')[0] + message = STORE.get_email(list_name, vote.messageid) + vote.message = message + return votes votes = property(_get_votes) -- cgit