View method to return columns sorted by timestamp.

This commit is contained in:
bsimpson63
2012-06-12 14:44:08 -04:00
committed by Neil Williams
parent 05f4028bce
commit d9e9507b92

View File

@@ -1272,6 +1272,14 @@ class View(ThingBase):
# TODO: at present this only grabs max_column_count columns
return self._t
@classmethod
def get_time_sorted_columns(cls, rowkey, limit=None):
q = cls._cf.xget(rowkey, include_timestamp=True)
r = sorted(q, key=lambda i: i[1][1]) # (col_name, (col_val, timestamp))
if limit:
r = r[:limit]
return OrderedDict([(i[0], i[1][0]) for i in r])
@classmethod
@will_write
def _set_values(cls, row_key, col_values,