Skip to content

Use modified time instead of created time for recording search queries #6155

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

Closed
dojutsu-user opened this issue Sep 9, 2019 · 3 comments · Fixed by #6234
Closed

Use modified time instead of created time for recording search queries #6155

dojutsu-user opened this issue Sep 9, 2019 · 3 comments · Fixed by #6234
Labels
Good First Issue Good for new contributors Improvement Minor improvement to code

Comments

@dojutsu-user
Copy link
Member

dojutsu-user commented Sep 9, 2019

We should use modified time here and not the created time.
modified time gets updated automatically, so the query should also be changed.

obj.created = time
obj.save()

partial_query_qs = SearchQuery.objects.filter(
project__slug=project_slug,
version__slug=version_slug,
created__gte=before_10_sec,
).order_by('-created')

Ref: #6088 (comment)

@dojutsu-user dojutsu-user added Good First Issue Good for new contributors Improvement Minor improvement to code labels Sep 9, 2019
@Iamshankhadeep
Copy link
Contributor

@dojutsu-user what do I need to know to start working on this issue?

@dojutsu-user
Copy link
Member Author

Hi @Iamshankhadeep
You can start working on this (Just a little knowledge of django ORM is required)
I think the issue description mentions everything.
Feel free to ask any doubts/questions if you get stuck anywhere. 😃

@Iamshankhadeep
Copy link
Contributor

@dojutsu-user never worked on django so trying to put together the pieces. I think we just need to change obj.created to obj.modified and order_by('-created') to order_by('-modified') right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good for new contributors Improvement Minor improvement to code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants