diff --git a/wcs/qommon/storage.py b/wcs/qommon/storage.py index ffed5f75f..dc2e6a4af 100644 --- a/wcs/qommon/storage.py +++ b/wcs/qommon/storage.py @@ -290,6 +290,9 @@ class StorableObject(object): # on all systems so we go the cheap and almost ok way. from .misc import simplify key_function = lambda x: simplify(x.name) + elif order_by.endswith('_time'): + typed_none = time.gmtime(-10**10) # 1653 + key_function = lambda x: getattr(x, order_by) or typed_none else: key_function = lambda x: getattr(x, order_by) objects.sort(key=key_function)