Skip to content

adds saved searches api and models - #116

Merged
chiatt merged 4 commits into
mainfrom
adg/saved-searches
Mar 23, 2026
Merged

chiatt merged 4 commits into
mainfrom
adg/saved-searches

Conversation

@aarongundel

Copy link
Copy Markdown
Contributor

Adds a saved search api/models

@aarongundel aarongundel linked an issue Mar 19, 2026 that may be closed by this pull request
@aarongundel
aarongundel requested a review from chiatt March 19, 2026 20:39
@aarongundel
aarongundel marked this pull request as ready for review March 19, 2026 20:39
Comment thread arches_search/views/api/saved_search.py Resolved
Comment thread arches_search/views/api/saved_search.py Outdated
saved_search=saved_search, group_id=group_id
)

saved_search.refresh_from_db()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem necessary at this point

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added to grab the "created_at" field and return it as part of the post response. But there's no particular reason to include it, unless the user for some reason wanted to verify that the field was actually populated (it's null after "create" because the value comes from the db.). For now I'll just add an arg to skip serializing it on post.

Comment thread arches_search/views/api/saved_search.py Outdated
group_shared = SavedSearch.objects.filter(
shared_groups__group__in=request.user.groups.all()
)
qs = (user_shared | group_shared).exclude(creator=request.user).distinct()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe saved_searches instead of qs just to be a bit more explicit?

@aarongundel
aarongundel requested a review from chiatt March 20, 2026 16:40

@chiatt chiatt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@chiatt
chiatt merged commit ca23433 into main Mar 23, 2026
6 checks passed
@chiatt
chiatt deleted the adg/saved-searches branch March 23, 2026 15:33
@chiatt chiatt added this to the Saved dynamic searches milestone Apr 10, 2026
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

Successfully merging this pull request may close these issues.

Saved search backend

2 participants