#NEWLINE# def setup( ) : #NEWLINE# #INDENT# global Book #NEWLINE# from query_delete_related.models import Book , Chapter #NEWLINE# b1 = Book . objects . create ( title = 'hi' ) #NEWLINE# b2 = Book . objects . create ( title = 'hi' ) #NEWLINE# b3 = Book . objects . create ( title = 'hi' ) #NEWLINE# for i in range ( 0 , 5 ) : #NEWLINE# #INDENT# Chapter . objects . create ( book = b1 , title = ( 'chapter%d' % Book ) ) #NEWLINE# Chapter . objects . create ( book = b2 , title = ( 'chapter%d' % i ) ) #NEWLINE# Chapter . objects . create ( book = b3 , title = ( 'chapter%d' % i ) )