Skip to content

Commit 8556671

Browse files
paulborgermansalanking
authored andcommitted
[#386] initial change to add create and modify times for metadata
1 parent e393b11 commit 8556671

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

irods/manager/metadata_manager.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,16 @@ def get(self, model_cls, path):
6969
'R': [Resource.name == path],
7070
'u': [User.name == path]
7171
}[resource_type]
72-
results = self.sess.query(model.id, model.name, model.value, model.units)\
72+
results = self.sess.query(model.id, model.name, model.value, model.units, model.create_time, model.modify_time)\
7373
.filter(*conditions).all()
7474
return [iRODSMeta(
7575
row[model.name],
7676
row[model.value],
7777
row[model.units],
78-
avu_id=row[model.id]
78+
avu_id=row[model.id],
79+
create_time=row[model.create_time],
80+
modify_time=row[model.modify_time],
81+
7982
) for row in results]
8083

8184
def add(self, model_cls, path, meta, **opts):
@@ -183,4 +186,3 @@ def _call_atomic_metadata_api(self, request_text):
183186
response = conn.recv()
184187
response_msg = response.get_json_encoded_struct()
185188
logger.debug("in atomic_metadata, server responded with: %r",response_msg)
186-

irods/meta.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
class iRODSMeta(object):
44

5-
def __init__(self, name, value, units=None, avu_id=None):
5+
def __init__(self, name, value, units=None, avu_id=None, create_time=None, modify_time=None):
66
self.avu_id = avu_id
77
self.name = name
88
self.value = value
99
self.units = units
10+
self.create_time = create_time
11+
self.modify_time = modify_time
1012

1113
def __eq__(self, other):
1214
return tuple(self) == tuple(other)

0 commit comments

Comments
 (0)