#NEWLINE# def hydrate( self , bundle ) : #NEWLINE# #INDENT# value = super ( DateTimeField , self ) . hydrate ( bundle ) #NEWLINE# if ( value and ( not hasattr ( value , 'year' ) ) ) : #NEWLINE# #INDENT# if isinstance ( value , six . string_types ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# value = make_aware ( parse ( value ) ) #NEWLINE# #UNINDENT# except ( ValueError , TypeError ) : #NEWLINE# #INDENT# raise ApiFieldError ( ( "Datetime provided to '%s' field doesn't appear to be a valid datetime string: '%s'" % ( self . instance_name , value ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# raise ApiFieldError ( ( "Datetime provided to '%s' field must be a string: %s" % ( self . instance_name , value ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return self