[Checkins] SVN: lovely.rating/trunk/src/lovely/rating/ ajax backend method implemented for rating

Manfred Schwendinger manfred.schwendiger at lovelysystems.com
Tue Sep 19 15:27:14 EDT 2006


Log message for revision 70242:
  ajax backend method implemented for rating

Changed:
  U   lovely.rating/trunk/src/lovely/rating/interfaces.py
  U   lovely.rating/trunk/src/lovely/rating/manager.py

-=-
Modified: lovely.rating/trunk/src/lovely/rating/interfaces.py
===================================================================
--- lovely.rating/trunk/src/lovely/rating/interfaces.py	2006-09-19 18:39:30 UTC (rev 70241)
+++ lovely.rating/trunk/src/lovely/rating/interfaces.py	2006-09-19 19:27:14 UTC (rev 70242)
@@ -88,6 +88,9 @@
         The result will be a list of tuples of the type ``(score,
         amount)``. ``score`` is in turn a tuple of ``(name, value)``.
         """
+        
+    def countAmountRatings(id):
+        """Counts the total amount of ratings for one definition"""
 
 
 class IRating(zope.interface.Interface):

Modified: lovely.rating/trunk/src/lovely/rating/manager.py
===================================================================
--- lovely.rating/trunk/src/lovely/rating/manager.py	2006-09-19 18:39:30 UTC (rev 70241)
+++ lovely.rating/trunk/src/lovely/rating/manager.py	2006-09-19 19:27:14 UTC (rev 70242)
@@ -104,6 +104,11 @@
         return [(score, value_count.get(score[0], 0))
                 for score in defn.scoreSystem.scores]
 
+    def countAmountRatings(self, id):
+        """See interfaces.IRatingManager"""
+        return len(self._storage.get(id, {}))
+        
+
     def __repr__(self):
         return '<%s for %r>' %(self.__class__.__name__, self.__parent__)
 



More information about the Checkins mailing list