Compare commits
No commits in common. "bfc45bd0f0725fe6e0ac11a4fc6b92b8ae97c0f5" and "dec145ada57735b8ab54f0222fe944dd7565b005" have entirely different histories.
bfc45bd0f0
...
dec145ada5
5 changed files with 10 additions and 25 deletions
|
|
@ -5,14 +5,6 @@ All notable changes to WuttaSync 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.5.1 (2026-02-13)
|
||||
|
||||
### Fix
|
||||
|
||||
- fix source/target data order for import diff warning email
|
||||
- fix importer `get_keys()` logic to honor class attribute
|
||||
- add date type coercion logic for CSV importer
|
||||
|
||||
## v0.5.0 (2026-01-03)
|
||||
|
||||
### Feat
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ build-backend = "hatchling.build"
|
|||
|
||||
[project]
|
||||
name = "WuttaSync"
|
||||
version = "0.5.1"
|
||||
version = "0.5.0"
|
||||
description = "Wutta Framework for data import/export and real-time sync"
|
||||
readme = "README.md"
|
||||
authors = [{name = "Lance Edgar", email = "lance@wuttaproject.org"}]
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
<h5>${model} - ${app.render_quantity(len(created) - max_diffs)} more records <em>created</em> in ${target_title} - not shown here</h5>
|
||||
% endif
|
||||
|
||||
% for obj, target_data, source_data in updated[:max_diffs]:
|
||||
% for obj, source_data, target_data in updated[:max_diffs]:
|
||||
<h5>${model} <em>updated</em> in ${target_title}: ${obj}</h5>
|
||||
<% diff = make_diff(target_data, source_data, nature="update") %>
|
||||
<div style="padding-left: 2rem;">
|
||||
|
|
|
|||
|
|
@ -379,10 +379,8 @@ class Importer: # pylint: disable=too-many-instance-attributes,too-many-public-
|
|||
# nb. prefer 'keys' but use 'key' as fallback
|
||||
if "keys" in self.__dict__:
|
||||
keys = self.__dict__["keys"]
|
||||
elif hasattr(self, "keys"):
|
||||
keys = self.keys
|
||||
elif hasattr(self, "key"):
|
||||
keys = self.key
|
||||
elif "key" in self.__dict__:
|
||||
keys = self.__dict__["key"]
|
||||
else:
|
||||
keys = self.default_keys
|
||||
|
||||
|
|
|
|||
|
|
@ -90,24 +90,19 @@ class TestImporter(DataTestCase):
|
|||
imp = self.make_importer(model_class=model.User)
|
||||
self.assertEqual(imp.get_keys(), ["uuid"])
|
||||
|
||||
# object dict may define 'keys'
|
||||
# class may define 'keys'
|
||||
imp = self.make_importer(model_class=model.User)
|
||||
with patch.dict(imp.__dict__, keys=["foo", "bar"]):
|
||||
with patch.object(imp, "keys", new=["foo", "bar"], create=True):
|
||||
self.assertEqual(imp.get_keys(), ["foo", "bar"])
|
||||
|
||||
# class may define 'keys'
|
||||
with patch.object(mod.Importer, "keys", new=["foo", "baz"], create=True):
|
||||
imp = self.make_importer(model_class=model.User)
|
||||
self.assertEqual(imp.get_keys(), ["foo", "baz"])
|
||||
|
||||
# class may define 'key'
|
||||
with patch.object(mod.Importer, "key", new="whatever", create=True):
|
||||
imp = self.make_importer(model_class=model.User)
|
||||
with patch.object(imp, "key", new="whatever", create=True):
|
||||
self.assertEqual(imp.get_keys(), ["whatever"])
|
||||
|
||||
# class may define 'default_keys'
|
||||
with patch.object(mod.Importer, "default_keys", new=["baz", "foo"]):
|
||||
imp = self.make_importer(model_class=model.User)
|
||||
with patch.object(imp, "default_keys", new=["baz", "foo"]):
|
||||
self.assertEqual(imp.get_keys(), ["baz", "foo"])
|
||||
|
||||
def test_process_data(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue