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

Extraction of original integer ID from queryset #73

Closed
Klim314 opened this issue Oct 11, 2022 · 1 comment
Closed

Extraction of original integer ID from queryset #73

Klim314 opened this issue Oct 11, 2022 · 1 comment

Comments

@Klim314
Copy link

Klim314 commented Oct 11, 2022

There are a number of packages that implement Smart Iteration for django querysets, typically using sequential integer keys (e.g. ). These often increment the resultant key by the chunksize, and assume an integer primary key to add to.

Would there be any form of escape hatch in which we could access the internal integer value of the field?

In the case of which there is none and someone else runs into this, a workaround would be to monkeypatch in the __add__ method, allowing down other modules to work as expected.

@nshafer
Copy link
Owner

nshafer commented Oct 11, 2022

I have added integer arithmetic methods to the Hashid object, so doing things like book.id + 100 should work. If it doesn't, please let me know what packages you're referring to so I can attempt to duplicate the problem.

@nshafer nshafer closed this as completed Oct 11, 2022
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