#NEWLINE# def load_samples( ) : #NEWLINE# #INDENT# for ( date_str , prec ) in DATES : #NEWLINE# #INDENT# date = datetime . strptime ( date_str , '%d/%m/%Y' ) . date ( ) #NEWLINE# models . Date ( date = date , precision = prec ) . save ( ) #NEWLINE# #UNINDENT# for ( date1_str , prec1 , date2_str , prec2 ) in DATE_RANGES : #NEWLINE# #INDENT# date1 = datetime . strptime ( date1_str , '%d/%m/%Y' ) . date ( ) #NEWLINE# date2 = datetime . strptime ( date2_str , '%d/%m/%Y' ) . date ( ) #NEWLINE# obj1 = models . Date . objects . create ( date = date1 , precision = prec1 ) #NEWLINE# obj2 = models . Date . objects . create ( date = date2 , precision = prec2 ) #NEWLINE# models . DateRange ( start = obj1 , end = obj2 ) . save ( ) #NEWLINE# #UNINDENT# for ( date_str , prec ) in OPEN_RANGES : #NEWLINE# #INDENT# date = datetime . strptime ( date_str , '%d/%m/%Y' ) . date ( ) #NEWLINE# obj = models . Date . objects . create ( date = date , precision = prec ) #NEWLINE# models . DateRange ( start = obj ) . save ( )