-
Notifications
You must be signed in to change notification settings - Fork 8
Add config option to set the default model tree #742
Comments
This should restrict the concepts and fields returned from /api/concepts and /api/fields in addition to being a parameter to contexts, correct? (So that the options in the left hand pane are represented correctly). Is this get parameter currently available on concepts/fields? I'm the trying the following, but it's not returning the subset of DataConcepts and DataFields that are traversable by the modeltree named 'volunteer' in settings.py.
|
@sgithens There is an issue for Serrano (chop-dbhi/serrano#214) to add support for filtering by tree. |
I just posted a PR for the Serrano issue: chop-dbhi/serrano#258 |
Great! Will try it out now. |
Filtering api/concepts looks good so far from the URL bar. Going to start messing with the cilantro UI. |
I'm currently hacking on this here: https://github.com/sgithens/cilantro/compare/cilantro-742 So far I've just experimented with adding a 'tree' parameter to the config, and slapping it on the end of all the bulk urls that get pulled from _links. On the surface this actually does quite a bit, by restricting the concepts available in the left pane, and also what columns are available for selection in the results page. And while this partially implicitily limits what is actually be queried (because you can only select the concepts on the left), I'm assuming we should be putting the 'tree' in the PUT request to api/context/ID to actually properly put the tree in the context? Does the api/context PUT endpoint support a tree parameter in serrano already? Also, my other concern is detecting and resetting the context when you hit different cilantro instances in the same app. For instance, starting with this functionality I'll likely create multiple links on my dashboard for searching different modeltree, and each cilantro view from django will put in a different modeltree root. So if you click between these cilantro views in the webapp, on each change it will need to reset the feeds and query that is in the process of refinement, etc, etc. Thoughts on the best way to detect and swap contexts like that would be helpful. I'm guessing maybe in cilantro we would look at the if a different modeltree is configured for that instance, and then look at stored contexts for the current user, and pull whatever one has that modeltree already, or create a new one if it doesn't exist. I'm also wondering, if under the saved queries, we should list all the users saved queries, or just the ones for the explicitly modeltree in the c.config. |
@sgithens Nice analysis. There are a few approaches to handling the
My gut tells me that third option makes the most sense. For a bit of background, I implemented the
That is an interesting question. Queries are not bound to particular tree, although some may not be valid simply because they included fields that are reachable by the current tree. This feels like there would need to be a higher-level means (more metadata, etc.) for switching context than just toggling the |
I've only had a bit of time to look at this again this week, and unfortunately am about to leave town through the next week. I hope to keep working on it again the week of Feb 9th. |
This involves setting the
tree
GET parameter on outbound request URLs. This would be implemented similarly to #686The text was updated successfully, but these errors were encountered: