moksha/api/widgets/grid.py | 2 +- moksha/lib/helpers.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
New commits: commit 8758f2f6cc4682e2cd5f5b3920d389d2060537f2 Author: Luke Macken lmacken@redhat.com Date: Fri May 29 06:11:37 2009 -0400
Allow our DateTimeDisplay.age method to take another DateTimeDisplay
diff --git a/moksha/lib/helpers.py b/moksha/lib/helpers.py index 29eb004..fa1ff83 100644 --- a/moksha/lib/helpers.py +++ b/moksha/lib/helpers.py @@ -981,6 +981,9 @@ class DateTimeDisplay(object): start = self.datetime if not end: end = datetime.utcnow() + else: + if isinstance(end, DateTimeDisplay): + end = end.datetime if tz: zone = timezone(tz) end = end.replace(tzinfo=utc)
commit d09bdc3f3ffe825e2e59e0a766271b38e97574ec Author: Luke Macken lmacken@redhat.com Date: Fri May 29 06:11:20 2009 -0400
Strip out trailing milli/micro seconds from timestamps after the in our DateTimeDisplay object
diff --git a/moksha/lib/helpers.py b/moksha/lib/helpers.py index 14b3bc4..29eb004 100644 --- a/moksha/lib/helpers.py +++ b/moksha/lib/helpers.py @@ -946,6 +946,8 @@ class DateTimeDisplay(object):
""" def __init__(self, timestamp, format='%Y-%m-%d %H:%M:%S'): + if '.' in timestamp: + timestamp = timestamp.split('.')[0] self.timestamp = timestamp if isinstance(timestamp, datetime): self.datetime = timestamp
commit 363116f24608da680b141646c86a601907cddaa1 Author: Luke Macken lmacken@redhat.com Date: Fri May 29 06:10:48 2009 -0400
Move our when_ready import to the top of the module
diff --git a/moksha/api/widgets/grid.py b/moksha/api/widgets/grid.py index 5b0b879..c417159 100644 --- a/moksha/api/widgets/grid.py +++ b/moksha/api/widgets/grid.py @@ -22,6 +22,7 @@ from tw.forms import FormField from tw.jquery.ui_core import jquery_ui_core_js from tw.jquery import jQuery, jquery_js
+from moksha.lib.helpers import when_ready
jquery_json_js = JSLink(filename='public/javascript/jquery.json.js', modname='moksha', javascript=[jquery_js]) @@ -80,5 +81,4 @@ class Grid(FormField):
d['id'] += "-uuid" + str(uuid.uuid4())
- from moksha.lib.helpers import when_ready self.add_call(when_ready(jQuery("#%s" % d['id']).mokshagrid(grid_d)))
moksha-commits@lists.fedorahosted.org