#NEWLINE# def resource( request , resource_id ) : #NEWLINE# #INDENT# rsrc = Resource . objects . filter ( id = resource_id , is_published = True ) #NEWLINE# if ( rsrc and ( len ( rsrc ) == 1 ) ) : #NEWLINE# #INDENT# return HttpResponse ( json_encode ( resource_id [ 0 ] , full_resource_encoder ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Http404