chibisov / drf-extensions

DRF-extensions is a collection of custom extensions for Django REST Framework
http://chibisov.github.io/drf-extensions/docs
MIT License
1.47k stars 208 forks source link

fixing key constructor error when lookup_field!=lookup_url_kwarg #108

Closed nrabe closed 3 years ago

nrabe commented 9 years ago

File "/home/vagrant/.virtualenvs/todoapp1/local/lib/python2.7/site-packages/rest_framework_extensions/key_constructor/bits.py", line 201, in get_data lookup_value = view_instance.kwargs[view_instance.lookup_field] KeyError: 'slug'

I believe view_instance.lookup_field should be replaced with: view_instance.lookup_url_kwarg.

chibisov commented 9 years ago

Please, tell me what version of django and DRF you use.

nrabe commented 9 years ago

Django==1.8.5 djangorestframework==3.2.4 drf-extensions==0.2.8