#NEWLINE# def get_url( self , obj , view_name , request , format ) : #NEWLINE# #INDENT# video = None #NEWLINE# if obj . is_child : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# video = request . parent . video #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# video = None #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# video = obj . video #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# video = None #NEWLINE# #UNINDENT# #UNINDENT# if video : #NEWLINE# #INDENT# kwargs = { #NEWLINE# #INDENT# 'cat_slug' : video . category . slug , #NEWLINE# 'vid_slug' : video . slug , #NEWLINE# #UNINDENT# } #NEWLINE# return reverse ( view_name , kwargs = kwargs , request = request , format = format ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return None