Merge pull request #353 from eReuse/bugfix/2656-update-in-list
get the last update of one device
This commit is contained in:
commit
26a803d1ab
|
@ -629,6 +629,14 @@ class Device(Thing):
|
||||||
return self.binding.device.devicehub_id
|
return self.binding.device.devicehub_id
|
||||||
return self.devicehub_id
|
return self.devicehub_id
|
||||||
|
|
||||||
|
@property
|
||||||
|
def get_updated(self):
|
||||||
|
if self.placeholder and self.placeholder.binding:
|
||||||
|
return max([self.updated, self.placeholder.binding.updated])
|
||||||
|
if self.binding:
|
||||||
|
return max([self.updated, self.binding.device.updated])
|
||||||
|
return self.updated
|
||||||
|
|
||||||
@declared_attr
|
@declared_attr
|
||||||
def __mapper_args__(cls):
|
def __mapper_args__(cls):
|
||||||
"""Defines inheritance.
|
"""Defines inheritance.
|
||||||
|
|
|
@ -437,7 +437,7 @@
|
||||||
<td>{% if dev.status %}{{ dev.status.type }}{% endif %}</td>
|
<td>{% if dev.status %}{{ dev.status.type }}{% endif %}</td>
|
||||||
<td>{% if dev.allocated_status %}{{ dev.allocated_status.type }}{% endif %}</td>
|
<td>{% if dev.allocated_status %}{{ dev.allocated_status.type }}{% endif %}</td>
|
||||||
<td>{% if dev.physical_status %}{{ dev.physical_status.type }}{% endif %}</td>
|
<td>{% if dev.physical_status %}{{ dev.physical_status.type }}{% endif %}</td>
|
||||||
<td>{{ dev.updated.strftime('%Y-%m-%d %H:%M:%S')}}</td>
|
<td>{{ dev.get_updated.strftime('%Y-%m-%d %H:%M:%S')}}</td>
|
||||||
<td>{{ dev.created.strftime('%Y-%m-%d %H:%M:%S')}}</td>
|
<td>{{ dev.created.strftime('%Y-%m-%d %H:%M:%S')}}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ dev.public_link }}" target="_blank">
|
<a href="{{ dev.public_link }}" target="_blank">
|
||||||
|
|
Reference in New Issue