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

Pass response when rebuild_after_method_evaluation #110

Closed stevelacey closed 5 months ago

stevelacey commented 9 years ago

I use the updated_at timestamp off of the instance in order to generate my object etags – for that I need to be able to retrieve the instance, which I current do by simply calling view_instance.get_object() – however, this will use the lookup_field and kwarg passed to filter the queryset.

Which is fine. Unless that field changed in an the request, e.g. it was an update.

Being able to grab the instance, or at the very least the response.data in the event that the etag is being calculated after method evaluation would be super handy for this use case.

stevelacey commented 9 years ago

@chibisov I'll invest the time fixing the rest of the implementation if you give me some feedback as to whether this is something you'd ever consider merging