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..
This commit is contained in:
parent
e27dad573b
commit
1248eae63b
2 changed files with 10 additions and 2 deletions
|
|
@ -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):
|
||||
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
""" """
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue