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

feature requests: support keep origin ordering of the queryset. #55

Open
ramwin opened this issue Mar 5, 2024 · 0 comments
Open

feature requests: support keep origin ordering of the queryset. #55

ramwin opened this issue Mar 5, 2024 · 0 comments

Comments

@ramwin
Copy link

ramwin commented Mar 5, 2024

In most cases, We want to sort a queryset by update_datetime and then iterate it.

e.g. send a message when an new vedio was published or updated.

last_update_datetime = cache.get("last-update-datetime")
for vedio in chunkator(Vedio.objects.filter(update_datetime__gte=last_update_datetime).order_by("update_datetime", 200):
    send_notify(vedio)
    cache.set("last-update-datetime", vedio.update_datetime)
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

1 participant