summaryrefslogtreecommitdiffstats
path: root/models.py
diff options
context:
space:
mode:
authorAamir Khan <syst3m.w0rm@gmail.com>2012-07-05 11:53:09 -0400
committerAamir Khan <syst3m.w0rm@gmail.com>2012-07-05 11:53:09 -0400
commit3db8dd7d9328e38fbc8eacf0f7553778bc31d94f (patch)
treeace66373e47453b92f8c7b7e51aae9c3c7e9c836 /models.py
parente39e81586dd268ce0cc5009f1c4b32a6985f8274 (diff)
downloadhyperkitty-3db8dd7d9328e38fbc8eacf0f7553778bc31d94f.tar.gz
hyperkitty-3db8dd7d9328e38fbc8eacf0f7553778bc31d94f.tar.xz
hyperkitty-3db8dd7d9328e38fbc8eacf0f7553778bc31d94f.zip
Display message snippet on user profile page
Diffstat (limited to 'models.py')
-rw-r--r--models.py11
1 files changed, 11 insertions, 0 deletions
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)