#NEWLINE# def get_class( datatype ) : #NEWLINE# #INDENT# if ( not isinstance ( datatype , basestring ) ) : #NEWLINE# #INDENT# return dynamic_cls #NEWLINE# #UNINDENT# parsed_datatype = datatype . split ( '/' ) #NEWLINE# dynamic_module = __import__ ( '.' . join ( parsed_datatype [ : ( - 1 ) ] ) , globals ( ) , locals ( ) , [ ] , level = ( - 1 ) ) #NEWLINE# if ( not dynamic_module ) : #NEWLINE# #INDENT# raise Exception ( ( 'no module for %s' % datatpye ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# dynamic_ptr = dynamic_module #NEWLINE# for attr in parsed_datatype [ 1 : ] : #NEWLINE# #INDENT# dynamic_ptr = getattr ( dynamic_ptr , attr ) #NEWLINE# #UNINDENT# dynamic_cls = dynamic_ptr #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# raise Exception ( ( 'no module for %s' % datatype ) ) #NEWLINE# #UNINDENT# dynamic_cls . datatype = datatype #NEWLINE# return dynamic_cls