def lookup_object(spec):
 (parts, target) = (spec.split(':') if (':' in spec) else (spec, None))
 module = __import__(parts)
 for part in (parts.split('.')[1:] + ([target] if target else [])):
  module = getattr(module, part)
 return module

def lookup_object ( spec ) : ( parts , target ) = ( spec . split ( ':' ) if ( ':' in spec ) else ( spec , None ) ) module = __import__ ( parts ) for part in ( parts . split ( '.' ) [ 1 : ] + ( [ target ] if target else [ ] ) ) : module = getattr ( module , part ) return module
return the model object with the passed object_id .