Skip to content

Instantly share code, notes, and snippets.

View ConorMcGee's full-sized avatar

Conor ConorMcGee

View GitHub Profile
@ConorMcGee
ConorMcGee / views.py
Last active August 29, 2015 14:17
Problem with Django rest swagger and get_serializer_class
def my_view_mocker(view):
view.request.tacos = 'Hi'
print "This is the viewmocker, just changed view.request.tacos to %s" % view.request.tacos
return view
class FileTree(generics.ListAPIView):
model = File
lookup_field = 'file_id'
paginate_by = 25
paginate_by_param = 'items'
from some_library import OriginalClass
class CustomClass(OriginalClass):
def original_method(*args, **kwargs):
# do stuff the way I want to do it instead of the way the library does it