[rhmessaging-commits] rhmessaging commits: r4346 - mgmt/newdata/cumin/python/cumin/grid.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Sep 27 09:56:48 EDT 2010


Author: eallen
Date: 2010-09-27 09:56:47 -0400 (Mon, 27 Sep 2010)
New Revision: 4346

Modified:
   mgmt/newdata/cumin/python/cumin/grid/limit.py
Log:
Display the current max limit on the form.
Display the max limit as an integer.

Modified: mgmt/newdata/cumin/python/cumin/grid/limit.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/limit.py	2010-09-27 13:45:38 UTC (rev 4345)
+++ mgmt/newdata/cumin/python/cumin/grid/limit.py	2010-09-27 13:56:47 UTC (rev 4346)
@@ -90,12 +90,17 @@
             return "Name"
 
         def render_content(self, session, data):
-            limit = data["name"]
+            limit_name = data["name"]
+            try:
+                limit_max = int(data["max"])
+            except:
+                limit_max = "0"
             negotiator = self.parent.data.get_negotiator(session)
             self.frame.limit.id.set(session, negotiator._id)
-            self.frame.limit.set_limit.form.limit_name.set(session, limit)
+            self.frame.limit.set_limit.form.limit_name.set(session, limit_name)
+            self.frame.limit.set_limit.form.limit_max.set(session, limit_max)
             href = self.frame.limit.set_limit.get_href(session)
-            return fmt_link(href, limit)
+            return fmt_link(href, limit_name)
 
     class CurrentColumn(NonSortableTableColumn):
         def render_title(self, session):
@@ -105,6 +110,13 @@
         def render_title(self, session):
             return "Max Allowance"
 
+        def render_content(self, session, data):
+            try:
+                limit_max = int(data["max"])
+            except:
+                limit_max = "0"
+            return limit_max
+
     class Limits(Attribute):
         def get_default(self, session):
             return dict()
@@ -128,6 +140,7 @@
 
     def do_enter(self, session, osession):
         self.form.limit_name.set(session, self.form.limit_name.get(osession))
+        self.form.limit_max.set(session, self.form.limit_max.get(osession))
 
     def do_invoke(self, invoc, negotiator, limit_name, limit_max):
         action = QmfCall(self.app)



More information about the rhmessaging-commits mailing list