Update timestampModified
of parent of a dependent record when uploaded records in the WorkBench
#5933
Replies: 4 comments
-
But this is not just for workbench, right? It would be for forms, and batch editor and agent merging and etc? Thus, it would have to be implemented on the back-end where resources are saved, not just for workbench |
Beta Was this translation helpful? Give feedback.
-
I would like to confirm that this is accurately reflecting our request. @maxpatiiuk , just to clarify, the forms are already behaving this way. We are just looking for consistency in behaviour when adding via forms or Workbench. One additional comment would be that purely from a database point of view the form changes to child tables of the CO should not actually change the datemodified field of the CO since technically nothing has changed in that table (apart from the version number). It would make more sense to add a new date field in tables like CO/CE/AGENT/LOAN etc. called GROUP_OBJECT_MODIFIED_DATE that could be referenced for our reporting purposes. This new field would be updated whenever the main table OR a child table object was created/edited. However I suspect this would be more work since you'd have to undo the current form behaviour, add columns to tables, and add a way for users to query on the group object modified date. |
Beta Was this translation helpful? Give feedback.
-
ah, thank you for the clarification. It might be that this behavior is already in place for Forms, but Workbench uses a separate mechanism for saving records, and doesn't implement this logic. In which case, indeed, this issue is only for Workbench - something we should address. Someone from the back-end side of sp7 would be able to provide a better answer. |
Beta Was this translation helpful? Give feedback.
-
The description / recreation steps here are a bit misleading. When you save a determination (or make a change to determination), the CO's modified date or version doesn't magically get updated due to change on determination. It only gets updated because the form for CO was open, and you were saving the CO. That is, if you were to open the determination separately (via /view/determination/ID), the CO's modified date / version will not get updated. I don't want to add a "over-encompassing" businessrule that triggers a save on all parent objects because I can see it being very buggy -- what if you are saving a CO, the determination will trigger a save on CO, for every determination? Plus, if those determinations have dependents, then you'll have those many times number of dets needless saves on CO (we can't use update to override)? It'll be faster in an alternate implemenation where we manually save() on related. If implemented correctly, we can use that same logic in workbench, without any duplication (just need to update toOne matched). We don't care about toMany (think why) BUT, I don't want to make this for specify in general. It'd be slow. We'd need to compare the performance. If it becomes too slow, we can add a django setting or a remote pref file. I want to add a django setting, since remove pref file fetch and read would itself be too slow, on each save of a record. |
Beta Was this translation helpful? Give feedback.
-
CSIRO wants WorkBench to automatically update the
timestampModified
of the Collection Object when a dependent record like determination, preparation, or attribute is uploaded and linked to it.When adding new dependent records on the form (determination, preparation, etc.), the
timestampedModified
is set to be the current time once saved.Expected Behavior:
timestampModified
of the parent record should be updated.timestampModified
set to the current time.timestampModified
set to the current time.timestampModified
set to the current time.Requested by: CSIRO on Asana
Beta Was this translation helpful? Give feedback.
All reactions