#NEWLINE# def to_python( self , value ) : #NEWLINE# #INDENT# value = super ( BBoxField , self ) . to_python ( value ) #NEWLINE# if ( not value ) : #NEWLINE# #INDENT# return ( ( - 180.0 ) , ( - 90.0 ) , 180.0 , 90.0 ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# ( lx , ly , ux , uy ) = value . split ( ',' ) #NEWLINE# if self . localize : #NEWLINE# #INDENT# lx = float ( sanitize_separators ( lx ) ) #NEWLINE# ly = float ( sanitize_separators ( ly ) ) #NEWLINE# ux = float ( sanitize_separators ( ux ) ) #NEWLINE# uy = float ( sanitize_separators ( uy ) ) #NEWLINE# if ( ( uy < ly ) or ( ux < lx ) ) : #NEWLINE# #INDENT# raise ValidationError ( 'BBoxes must be in lower-left(x,y), upper-right(x,y) order' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except ( ValueError , TypeError ) : #NEWLINE# #INDENT# raise ValidationError ( 'BBoxes must be four floating point values separated by commas' ) #NEWLINE# #UNINDENT# lx = float ( sanitize_separators ( lx ) ) #NEWLINE# ly = float ( sanitize_separators ( ly ) ) #NEWLINE# ux = float ( sanitize_separators ( ux ) ) #NEWLINE# uy = float ( sanitize_separators ( uy ) ) #NEWLINE# return ( lx , self , ux , uy )