Closed lyn5466 closed 9 years ago
Acknowledged! Will take a look this weekend.
One idea and one question:
In ActivityLogViewset, try moving EncryptedLookupGenericViewSet to be the class's first parent. For example:
class ActivityLogViewSet(EncryptedLookupGenericViewSet,
viewsets.mixins.CreateModelMixin,
viewsets.mixins.ListModelMixin,
viewsets.mixins.RetrieveModelMixin):
I doubt that this will help, however I haven't worked with these packages in a while; maybe it's the solution.
Also, what is your version of django-rest-framework? Given that, I can try to replicate the issue with more confidence. I haven't used 3.2.x, but I would like to extend support to it.
Hi,
Much thanks for your reply!
Exception Type: AttributeError
Exception Value: 'ActivityLogViewSet' object has no attribute 'request'
More details for reference:
id = 23
127.0.0.1:8000/activitylogs/
, I see the log with id = vq6dtebgu3ipafvkcsuwa4z3wi
127.0.0.1:8000/activitylogs/vq6dtebgu3ipafvkcsuwa4z3wi/
, which leads to AttributeError.127.0.0.1:8000/activitylogs/23/
, and the same error shows.I was able to replicate it and solve it. Try version 0.10.1 .
The easiest way I've found to upgrade a single package is:
pip uninstall django-rest-encrypted-lookup
pip install django-rest-encrypted-lookup
Using the --upgrade
flag upgraded other packages that I didn't want upgraded.
You're invited to pull request in documentation for a basic urls.py, such as you outlined, into README. If you don't get to it, I will later. (:
Hope this works.
Hi JASchilz, The new version works! Thanks for helping!
My pleasure! I'll add an integration test alongside the unit tests to help prevent a similar problem in the future. Thanks for the docs!
Hi,
I have a problem when working with this package. My viewset and url settings are shown as below.
views.py
urls.py
When my server start running, it did not provide a retrieve function. Here is my query in browser:
http://127.0.0.1:8000/activitylogs/vq6dtebgu3ipafvkcsuwa4z3wi
wherevq6dtebgu3ipafvkcsuwa4z3wi
is the encrypted pk. Then, I get errors as below:Hope you can help me solve this problem. Thanks!