I’m using this snippet https://gist.github.com/735861 to encrypt the pk of my model.
If I use the normal way of getting a single object MyModel.object.get(encrypted_pk=url_pk) it works flawlessly. But if I use the get_object_or_none function from here it throws the following error FieldError. Cannot resolve keyword 'encrypted_pk' into field.
I suspect the problem is the way the manager is implemented. Any way to fix it?
I think it can be solved in such way:
Because in
get_object_or_NoneQuerySet is builded asmodel.manager.all().get(...)andall()returns QuerySet instance.