Conversation
|
|
||
| @staticmethod | ||
| def filter_tags(queryset, _, value): | ||
| """Use all tags when filtering.""" |
There was a problem hiding this comment.
So there is a derived property tags that is the combination of owner_tags and admin_tags, and that's what the query filter searches. Is that right?
There was a problem hiding this comment.
It can't use the property since that's not available for the database query. But, it does something similar in this method:
Q(owner_tags__name__in=tags) | Q(admin_tags__name__in=tags)
There was a problem hiding this comment.
Ah, I see.
I like that, because it would allow me the admin to go set the "lesson 1" admin)tag on a program if the user does not set it as a owner_tag, and user searches will return it.
But, one use case I was thinking of was a section on the landing page for "Featured Programs". I imagined it being populated by querying for admin_tag="featured program". For that, we'd need to be able to query by admin_tag alone, right? Otherwise, a user could set an owner tag of "featured program" and put their program in the section on the landing page.
There was a problem hiding this comment.
Yes, for that feature, we'll need to add admin_tags to the BlockDiagramFilter. I'll go ahead and make that change. I can make a filter on owner_tags as well if we think that might be a use case in the future as well
There was a problem hiding this comment.
Yeah, probably can't hurt to have every option?
Closes #242
Adds
owner_tagsandadmin_tagsto programs. Programs can be filtered by a list of tags. The filtering looks at bothowner_tagsandadmin_tagsfor a match. Right now onlyowner_tagsare set through the API until there is a better definition of who anadminis for setting theadmin_tags.