def get_model_url(object, kind=u'detail', user=None, required_permissions=None):
 for module in get_modules():
  url = module.get_model_url(object, kind)
  if (not url):
   continue
  if (user is None):
   return url
  else:
   permissions = ()
   if (required_permissions is not None):
    permissions = required_permissions
   else:
    permissions = get_default_model_permissions(object)
   if (not get_missing_permissions(user, permissions)):
    return url
 raise NoModelUrl((u"Can't get object URL of kind %s: %r" % (kind, force_text(object))))

def get_model_url ( object , kind = u'detail' , user = None , required_permissions = None ) : for module in get_modules ( ) : url = module . get_model_url ( object , kind ) if ( not url ) : continue if ( user is None ) : return url else : permissions = ( ) if ( required_permissions is not None ) : permissions = required_permissions else : permissions = get_default_model_permissions ( object ) if ( not get_missing_permissions ( user , permissions ) ) : return url raise NoModelUrl ( ( u"Can't get object URL of kind %s: %r" % ( kind , force_text ( object ) ) ) )
get a an admin object url for the given object or object class by interrogating each admin module .