def get_domain_object(model, domain_object_ref):
 if (domain_object_ref in ('system', 'System')):
  return model.System
 pkg = model.Package.get(domain_object_ref)
 if pkg:
  return pkg
 group = model.Group.get(domain_object_ref)
 if group:
  return group
 user = model.User.get(domain_object_ref)
 if user:
  return user
 raise NotFound(('Domain object %r not found' % domain_object_ref))

def get_domain_object ( model , domain_object_ref ) : if ( domain_object_ref in ( 'system' , 'System' ) ) : return model . System pkg = model . Package . get ( domain_object_ref ) if pkg : return pkg group = model . Group . get ( domain_object_ref ) if group : return group user = model . User . get ( domain_object_ref ) if user : return user raise NotFound ( ( 'Domain object %r not found' % domain_object_ref ) )
for an id or name .