#NEWLINE# def make_meta( self , app , model , data , stub = False ) : #NEWLINE# #INDENT# 'Makes a Meta class out of a dict of eval-able arguments.' #NEWLINE# results = { #NEWLINE# #INDENT# 'app_label' : app , #NEWLINE# #UNINDENT# } #NEWLINE# for ( key , code ) in data . items ( ) : #NEWLINE# #INDENT# if ( key in [ '_bases' , '_ormbases' ] ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( stub and ( key in [ 'order_with_respect_to' ] ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# results [ key ] = self . eval_in_context ( code , key ) #NEWLINE# #UNINDENT# except ( NameError , AttributeError ) as e : #NEWLINE# #INDENT# raise ValueError ( ( "Cannot successfully create meta field '%s' for model '%s.%s': %s." % ( key , app , model , e ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return type ( 'Meta' , tuple ( ) , results )