-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add support for TextField pk #46
Comments
Let's discuss adding support for
Coming back to Currently django-sesame is able to encode / decode integers and UUID, which are fixed length — 4 bytes and 16 bytes respectively. The token format is designed to be as compact as possible (because long URLs are ugly, get truncated accidentally, etc.) So django-sesame just reads the expected number of bytes from the token. There's nothing else. Since strings are variable length, the most generic format would be 1 byte for the length of the UTF-8 encoded string, followed by the UTF-8 encoded string. (Supporting only up to 255 characters would be an acceptable limitation for an user id that ends up in a URL.) This wouldn't be optimal for flax-id, though:
There's no way django-sesame can determine and handle all this, so the only way to allow these optimizations is to make the packer configurable. To sum up:
|
This is great! Thank you 🌟 |
I use a TextField pk, specifically https://github.com/ergeon/python-flax-id
The text was updated successfully, but these errors were encountered: