Often, one must record housekeeping information in a row, e.g., transaction id for an item purchased. This is usually put in its own set of columns, separate from the columns that a user should see.
Existing mechanisms can filter the rows, so that a user can see only the rows they “own”, but (unless I’m missing something) it doesn’t filter out app-private columns. But if we leave that to Python code, then we have to return the result as a list
of dict
s. Unfortunately, returning an accurate list means returning all the rows, even if the UI is working one “page” at a time (DataGrid). For rows that are large, or large in number, this can mean a substantial delay.
A pausable Server-side BackgroundTask might be able to page the data, but there is currently no means for the Client to communicate to a BackgroundTask, to tell it to switch to the next/previous page.
4 Likes
I like this feature request. It’d be analogous to using SQL and selecting only the columns you’re interested in seeing.
Agreed, this would be very useful. I’m bumping this on feature requests!
2 Likes
I’d like to extend this notion, to include returning computed columns. (Inspired by ongoing work at sqlite.org.)
1 Like
This would be a fantastic feature. I frequently have tables and want to return only ‘public’ columns while holding back private columns. Most frequently, I end up with a “verified by” column linking to some user row in the Users table, and don’t want to pass the logged-in user that OTHER user’s row object.
Specifically I’d like client_readable to take a list of column names, and return a search object with only those columns. I could do this as a list of dictionaries as you say, but then lose all the benefits of the ‘rows’ class (like the laziness you mention).
I’d like this feature too!
Especially useful in combination with the .to_csv().url
functionality.
I’ve been wondering about adding something similar to my orm - perhaps using a leading underscore on a data table column name to indicate that it shouldn’t be included when instantiating the portable class.
1 Like
It’s now clear that this can be accomplished via Portable Classes.
If anyone has already done that, this would be a good place to post the code, so that no one needs to reinvent that wheel.
1 Like