diff --git a/Pipfile b/Pipfile index ac4e618..987d8b7 100644 --- a/Pipfile +++ b/Pipfile @@ -4,7 +4,7 @@ verify_ssl = true name = "pypi" [packages] -viur-core = "==3.7.0.dev3" +viur-core = {file = "../viur-core", editable = true} [dev-packages] viur-cli = "~=2.0" diff --git a/Pipfile.lock b/Pipfile.lock index fe016ff..79b6339 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "b30be29f78fc0c1b8c7c5e43303f9d3fbc4b814835667b97aa9bbc20c145498d" + "sha256": "b763c95a1bc4002b32fa6879a896bfa9f903233643c5071aef04664020e8b32c" }, "pipfile-spec": 6, "requires": { @@ -1000,12 +1000,9 @@ "version": "==2.2.0" }, "viur-core": { - "hashes": [ - "sha256:14eaa3dcb2f5e36d1191870788facca3a0c58d951a1fda1fa56b3c9c3e42e16e" - ], - "index": "pypi", - "markers": "python_version >= '3.10'", - "version": "==3.7.0.dev3" + "editable": true, + "file": "../viur-core", + "markers": "python_version >= '3.10'" }, "viur-datastore": { "hashes": [ diff --git a/deploy/modules/todo.py b/deploy/modules/todo.py index 5298bd4..7f60768 100644 --- a/deploy/modules/todo.py +++ b/deploy/modules/todo.py @@ -96,20 +96,18 @@ class TodoAssignSkel(ActionSkel): action_skel.setBoneValue("todo", key, append=True) if not kwargs or not action_skel.fromClient(kwargs): - # TODO: Provide generic render action skel - return self.render.edit(action_skel, "assign") + return self.render.render("assign", action_skel) - # TODO: Add program logic here - # TODO: Create skel.update() function for transactional in-place update for todo in action_skel["todo"]: - skel = self.editSkel() - skel.fromDB(todo["dest"]["key"]) - skel["status"] = "open" - skel.setBoneValue("user", action_skel["user"]["dest"]["key"]) - skel.toDB() - - # TODO: Provide generic render action success - return self.render.editSuccess(action_skel, "assignSuccess") + self.editSkel().update( + values={ + "status": "open", + "user": action_skel["user"]["dest"]["key"], + }, + key=todo["dest"]["key"], + ) + + return self.render.render("assignSuccess", action_skel) def listFilter(self, query): if query := super().listFilter(query): diff --git a/deploy/skeletons/todo.py b/deploy/skeletons/todo.py index b43d554..f787046 100644 --- a/deploy/skeletons/todo.py +++ b/deploy/skeletons/todo.py @@ -55,7 +55,7 @@ class TodoSkel(skeleton.Skeleton): status = SelectBone( descr="Status", required=True, - defaultValue="open", + defaultValue="new", values={ "new": "Neu", "open": "Zugewiesen",