summaryrefslogtreecommitdiffstats
path: root/models.py
diff options
context:
space:
mode:
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)