Compare commits

..

3 commits

Author SHA1 Message Date
8fc9851e21 bump: version 0.11.3 → 0.11.4 2026-05-30 12:03:35 -05:00
457446fb4d fix: add "delete log" support for data export to farmOS 2026-05-30 12:01:55 -05:00
1248eae63b fix: sort farmOS data fetch when importing/exporting logs
may need to add this to other things like assets and quantities? but
so far logs were the only one exhibiting a problem for me..
2026-05-30 12:00:12 -05:00
4 changed files with 23 additions and 3 deletions

View file

@ -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/)
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)
### Fix

View file

@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "WuttaFarm"
version = "0.11.3"
version = "0.11.4"
description = "Web app to integrate with and extend farmOS"
readme = "README.md"
authors = [

View file

@ -781,7 +781,11 @@ class ToFarmOSLog(ToFarmOS):
self.normal = self.app.get_normalizer(self.farmos_client)
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):
@ -906,6 +910,11 @@ class ToFarmOSLog(ToFarmOS):
payload = {"attributes": attrs, "relationships": rels}
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):

View file

@ -1254,7 +1254,11 @@ class LogImporterBase(FromFarmOS, ToWutta):
def get_source_objects(self):
""" """
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):
""" """