summaryrefslogtreecommitdiffstats
path: root/hyperkitty/models.py
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-02-14 17:43:19 +0100
committerAurélien Bompard <aurelien@bompard.org>2013-02-14 17:43:19 +0100
commit5e894dd453c4b4b553b702f0b61c2e8315265297 (patch)
tree16896fc8ffb9f4c187a673b735d667080704ed10 /hyperkitty/models.py
parent3ae10864b6289edbc4d756bad5d6a4276f0ab368 (diff)
downloadhyperkitty-5e894dd453c4b4b553b702f0b61c2e8315265297.tar.gz
hyperkitty-5e894dd453c4b4b553b702f0b61c2e8315265297.tar.xz
hyperkitty-5e894dd453c4b4b553b702f0b61c2e8315265297.zip
Add HK models to the admin interface
Diffstat (limited to 'hyperkitty/models.py')
-rw-r--r--hyperkitty/models.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/hyperkitty/models.py b/hyperkitty/models.py
index 370908f..9cfb4ef 100644
--- a/hyperkitty/models.py
+++ b/hyperkitty/models.py
@@ -22,8 +22,8 @@
from django.db import models
from django.contrib.auth.models import User
from django.conf import settings
+from django.contrib import admin
-from kittystore import get_store
class Rating(models.Model):
@@ -40,9 +40,13 @@ class Rating(models.Model):
def __unicode__(self):
"""Unicode representation"""
if self.vote == 1:
- return u'id = %s : %s voted up %s' % (self.id, unicode(self.user), self.messageid)
+ return u'%s liked message %s' % (unicode(self.user),
+ unicode(self.messageid))
else:
- return u'id = %s : %s voted down %s' % (self.id, unicode(self.user), self.messageid)
+ return u'%s disliked message %s' % (unicode(self.user),
+ unicode(self.messageid))
+
+admin.site.register(Rating)
class UserProfile(models.Model):
@@ -67,7 +71,10 @@ class Tag(models.Model):
def __unicode__(self):
"""Unicode representation"""
- return u'threadid = %s , tag = %s ' % (unicode(self.threadid), unicode(self.tag))
+ return u'Tag %s on thread %s in list %s' % (unicode(self.tag),
+ unicode(self.threadid), unicode(self.list_address))
+
+admin.site.register(Tag)
class Favorite(models.Model):
@@ -77,4 +84,7 @@ class Favorite(models.Model):
def __unicode__(self):
"""Unicode representation"""
- return u'thread %s for user %s' % (unicode(self.threadid), unicode(self.user))
+ return u"Thread %s is a favorite of %s" % (unicode(self.threadid),
+ unicode(self.user))
+
+admin.site.register(Favorite)