]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/models/action.py
this will change the color of the number of answers to red.
[osqa.git] / forum / models / action.py
index 790997491c9dc986eb17a93bcc66d386ed3a59de..785ed2da965a5461e794f97fcade2cc476068b65 100644 (file)
@@ -70,7 +70,7 @@ class Action(models.Model):
         return ""\r
 \r
     def describe(self, viewer=None):\r
-        return ""\r
+        return self.__class__.__name__\r
 \r
     def get_absolute_url(self):\r
         if self.node:\r
@@ -219,11 +219,20 @@ class ActionProxy(Action):
     class Meta:\r
         proxy = True\r
 \r
-class DummyActionProxy(Action):\r
-    __metaclass__ = ActionProxyMetaClass\r
+class DummyActionProxyMetaClass(type):\r
+    def __new__(cls, *args, **kwargs):\r
+        new_cls = super(DummyActionProxyMetaClass, cls).__new__(cls, *args, **kwargs)\r
+        ActionProxyMetaClass.types[new_cls.get_type()] = new_cls\r
+        return new_cls\r
+\r
+class DummyActionProxy(object):\r
+    __metaclass__ = DummyActionProxyMetaClass\r
 \r
     hooks = []\r
 \r
+    def __init__(self, ip=None):\r
+        self.ip = ip\r
+\r
     def process_data(self, **data):\r
         pass\r
 \r