feat: add support for exporting log status, timestamp to farmOS
This commit is contained in:
parent
61402c183e
commit
a5550091d3
2 changed files with 12 additions and 0 deletions
|
|
@ -458,6 +458,8 @@ class ToFarmOSLog(ToFarmOS):
|
||||||
supported_fields = [
|
supported_fields = [
|
||||||
"uuid",
|
"uuid",
|
||||||
"name",
|
"name",
|
||||||
|
"timestamp",
|
||||||
|
"status",
|
||||||
"notes",
|
"notes",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -513,6 +515,8 @@ class ToFarmOSLog(ToFarmOS):
|
||||||
return {
|
return {
|
||||||
"uuid": UUID(log["id"]),
|
"uuid": UUID(log["id"]),
|
||||||
"name": log["attributes"]["name"],
|
"name": log["attributes"]["name"],
|
||||||
|
"timestamp": self.normalize_datetime(log["attributes"]["timestamp"]),
|
||||||
|
"status": log["attributes"]["status"],
|
||||||
"notes": notes,
|
"notes": notes,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -521,6 +525,10 @@ class ToFarmOSLog(ToFarmOS):
|
||||||
attrs = {}
|
attrs = {}
|
||||||
if "name" in self.fields:
|
if "name" in self.fields:
|
||||||
attrs["name"] = source_data["name"]
|
attrs["name"] = source_data["name"]
|
||||||
|
if "timestamp" in self.fields:
|
||||||
|
attrs["timestamp"] = self.format_datetime(source_data["timestamp"])
|
||||||
|
if "status" in self.fields:
|
||||||
|
attrs["status"] = source_data["status"]
|
||||||
if "notes" in self.fields:
|
if "notes" in self.fields:
|
||||||
attrs["notes"] = {"value": source_data["notes"]}
|
attrs["notes"] = {"value": source_data["notes"]}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -360,6 +360,8 @@ class FromWuttaFarmLog(FromWuttaFarm):
|
||||||
supported_fields = [
|
supported_fields = [
|
||||||
"uuid",
|
"uuid",
|
||||||
"name",
|
"name",
|
||||||
|
"timestamp",
|
||||||
|
"status",
|
||||||
"notes",
|
"notes",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -367,6 +369,8 @@ class FromWuttaFarmLog(FromWuttaFarm):
|
||||||
return {
|
return {
|
||||||
"uuid": log.farmos_uuid or self.app.make_true_uuid(),
|
"uuid": log.farmos_uuid or self.app.make_true_uuid(),
|
||||||
"name": log.message,
|
"name": log.message,
|
||||||
|
"timestamp": log.timestamp,
|
||||||
|
"status": log.status,
|
||||||
"notes": log.notes,
|
"notes": log.notes,
|
||||||
"_src_object": log,
|
"_src_object": log,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue