-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow definition of custom functions / classes at document level #386
Comments
While thinking about it, it would also be practical to have the option to define class functions for each table. |
This would be super helpful keeping my DB functions clean and easy to update |
Yes, indeed very useful |
It does seems a good idea. For UI, I could imagine an editable region in the Code Viewer. The data engine would need a bit of tweaking to make it use the code, and update correctly when it changes. If anyone wants to take a shot at it, it does seem an achievable feature, though not trivial. |
While it's not a solution, unfortunately, but a workaround that could be helpful for someone who found this page via googling: https://community.getgrist.com/t/install-third-party-libraries/1087/3 TL;DR; you need to create your own Dockerfile with injecting all the necessary additional Python libraries in it. |
This is an idea I had several times, but which is very well illustrated by this case: it’s sometimes necessary to use custom functions / classes, and while they can be defined within column formulas, this leads to code duplication. It would be very handy if we had a way to add python code that would go to the top of the code, just after imports:
In the case linked, this would allow to define
SList
at the document level, not within the function body.The text was updated successfully, but these errors were encountered: