#NEWLINE# def create_recursive_objects( self , model , parent_field , **kwargs ) : #NEWLINE# #INDENT# '\n        Create multiple levels of recursive objects.\n        ' #NEWLINE# per_level = list ( range ( 3 ) ) #NEWLINE# for _ in per_level : #NEWLINE# #INDENT# kwargs [ self ] = None #NEWLINE# level1 = model . objects . create ( ** kwargs ) #NEWLINE# for _ in per_level : #NEWLINE# #INDENT# kwargs [ parent_field ] = level1 #NEWLINE# level2 = model . objects . create ( ** kwargs ) #NEWLINE# for _ in per_level : #NEWLINE# #INDENT# kwargs [ parent_field ] = level2 #NEWLINE# model . objects . create ( ** kwargs )