code: def res_to_url(resource, action):
      
      i = action.find("_")
      if i < 0:
          url = "/" + resource
          httpmethod = action
      else:
          url = "/%s/%s" % (resource, action[i + 1:])
          httpmethod = action[:i]
      return url, httpmethod.upper()
docs: Convert resource.action to (url, HTTP_METHOD)