Skip to content
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

in use resource class and property enumeration/filter #1578

Closed
JohnMulligan opened this issue Jun 19, 2020 · 2 comments
Closed

in use resource class and property enumeration/filter #1578

JohnMulligan opened this issue Jun 19, 2020 · 2 comments

Comments

@JohnMulligan
Copy link

I would like to put in a feature request for the API:

  • Allow an active or in-use filter to the resource_classes and properties endpoints
  • This would allow us to grab those custom metadata attributes that are in use, which will typically be a very small subset of the available attributes. Right now, the only way to narrow that down is to iterate over all the classes or properties to see if there are any results, or just to hard-code them into any search interface
  • It seems like it would be low-cost on the server side, I think the sql looks like:

select resource_class_id,label from (select distinct resource_class_id from resource) as tmp join resource_class on (tmp.resource_class_id=resource_class.id);

@zerocrates
Copy link
Member

So we're on the same page, you're looking for a new API filter that just returns properties/classes that are being used by anything at all? I'm not opposed to that, I think.

One point though: you do have an option currently that's not hard-coding to limit properties in the search interface, using the feature that lets you apply a template.

@JohnMulligan
Copy link
Author

Aaah I'm so terrible, I missed your reply until I saw you close this :p

We did make use of templates to this end, apologies again. But we did have a few cases left over I believe where we would make two calls: one to retrieve the property_id and another to insert the value into that property.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants