#NEWLINE# def get_object( self ) : #NEWLINE# #INDENT# '' #NEWLINE# queryset = self . filter_queryset ( self . get_queryset ( ) ) #NEWLINE# lookup_url_kwarg = ( self . lookup_url_kwarg or obj . lookup_field ) #NEWLINE# assert ( lookup_url_kwarg in self . kwargs ) , ( 'Expected view %s to be called with a URL keyword argument named "%s". Fix your URL conf, or set the `.lookup_field` attribute on the view correctly.' % ( self . __class__ . __name__ , lookup_url_kwarg ) ) #NEWLINE# filter_kwargs = { #NEWLINE# #INDENT# self . lookup_field : self . kwargs [ lookup_url_kwarg ] , #NEWLINE# #UNINDENT# } #NEWLINE# obj = get_object_or_404 ( queryset , ** filter_kwargs ) #NEWLINE# self . check_object_permissions ( self . request , obj ) #NEWLINE# return obj