Currently, the sole method available for saving data in my application involves storing it within fields or tables. However, much of this data serves background purposes exclusively. Presently, I’ve resorted to employing 20 hidden fields within the frontend section of my application. This approach feels disorganized and unconventional. Would it be advisable to integrate functions capable of directly inserting, updating, deleting, and creating objects within the database without relying on visible or hidden fields?
Hi Tim,
You can also use our persistent storage functionality to store data, which I think in many cases is preferred to using a HiddenField
.
Are you aware of this functionality? If Storage
is not suitable for your use case, could you explain why this is the case. That way we can think about ways to improve the feature.
I don’t really want to store files. I want to store bools, ints, strings, datetimes, and more types in an overviewable way without needing to put them in a file and read that file again. I think that all those actions would slow down my code, and I really try to find the best way to make my code as fast as possible because Python is not really a fast coding language.
As long as you are using single values it is probably quickest to use the HiddenField
for this. The fields in your Parametrization
make up the complete set of parameters that are stored in the database of the workspace when you create a revision.
However, keep in mind that all parameters are returned as response on every input change. If the data becomes large(r) this might impact responsiveness of your app. In that case, or when you only need to use some of the data in specific cases, you might be better off using the Storage
feature.