Compare commits
3 commits
e27dad573b
...
8fc9851e21
| Author | SHA1 | Date | |
|---|---|---|---|
| 8fc9851e21 | |||
| 457446fb4d | |||
| 1248eae63b |
4 changed files with 23 additions and 3 deletions
|
|
@ -5,6 +5,13 @@ All notable changes to WuttaFarm will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## v0.11.4 (2026-05-30)
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- add "delete log" support for data export to farmOS
|
||||||
|
- sort farmOS data fetch when importing/exporting logs
|
||||||
|
|
||||||
## v0.11.3 (2026-05-04)
|
## v0.11.3 (2026-05-04)
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "WuttaFarm"
|
name = "WuttaFarm"
|
||||||
version = "0.11.3"
|
version = "0.11.4"
|
||||||
description = "Web app to integrate with and extend farmOS"
|
description = "Web app to integrate with and extend farmOS"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [
|
authors = [
|
||||||
|
|
|
||||||
|
|
@ -781,7 +781,11 @@ class ToFarmOSLog(ToFarmOS):
|
||||||
self.normal = self.app.get_normalizer(self.farmos_client)
|
self.normal = self.app.get_normalizer(self.farmos_client)
|
||||||
|
|
||||||
def get_target_objects(self, **kwargs):
|
def get_target_objects(self, **kwargs):
|
||||||
return list(self.farmos_client.log.iterate(self.farmos_log_type))
|
# nb. must sort the data or else paging / iteration will not
|
||||||
|
# work correctly and we get back data set which contains
|
||||||
|
# duplicates but also is missing some records...
|
||||||
|
params = {"sort": "drupal_internal__id"}
|
||||||
|
return list(self.farmos_client.log.iterate(self.farmos_log_type, params=params))
|
||||||
|
|
||||||
def get_target_object(self, key):
|
def get_target_object(self, key):
|
||||||
|
|
||||||
|
|
@ -906,6 +910,11 @@ class ToFarmOSLog(ToFarmOS):
|
||||||
payload = {"attributes": attrs, "relationships": rels}
|
payload = {"attributes": attrs, "relationships": rels}
|
||||||
return payload
|
return payload
|
||||||
|
|
||||||
|
def delete_target_object(self, obj):
|
||||||
|
if not self.dry_run:
|
||||||
|
self.farmos_client.log.delete(self.farmos_log_type, obj["id"])
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class ActivityLogImporter(ToFarmOSLog):
|
class ActivityLogImporter(ToFarmOSLog):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1254,7 +1254,11 @@ class LogImporterBase(FromFarmOS, ToWutta):
|
||||||
def get_source_objects(self):
|
def get_source_objects(self):
|
||||||
""" """
|
""" """
|
||||||
log_type = self.get_farmos_log_type()
|
log_type = self.get_farmos_log_type()
|
||||||
return list(self.farmos_client.log.iterate(log_type))
|
# nb. must sort the data or else paging / iteration will not
|
||||||
|
# work correctly and we get back data set which contains
|
||||||
|
# duplicates but also is missing some records...
|
||||||
|
params = {"sort": "drupal_internal__id"}
|
||||||
|
return list(self.farmos_client.log.iterate(log_type, params=params))
|
||||||
|
|
||||||
def normalize_source_object(self, log):
|
def normalize_source_object(self, log):
|
||||||
""" """
|
""" """
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue