#NEWLINE# def get_parent( self ) : #NEWLINE# #INDENT# '\n        Get the parent model. Returns None if current element is the root element.\n        ' #NEWLINE# if self . parent_id : #NEWLINE# #INDENT# for model in CascadeModelBase . _get_cascade_elements ( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return model . objects . get ( id = model . parent_id ) #NEWLINE# #UNINDENT# except ObjectDoesNotExist : #NEWLINE# #INDENT# pass