Python:获取 URL

发布于 2024-09-09 08:07:40 字数 422 浏览 0 评论 0 原文

因为我无法正常工作: Python: KeyError with form.getfirst

我有一个替代方案选项,我在 DTML 中有一个函数需要获取 URL:

例如,如果 dtml 网页位于

www.blah.com/foo/foo2?variable=55

我如何使用python函数获取此页面的URL?

该函数的调用方式为:

<dtml-var test>

“test”的语法是 rite,Zope 文档是这么说的。

Because I cant get this working: Python: KeyError with form.getfirst

I have an alternative option, I have a function in DTML which needs to obtain a URL:

For example if the dtml webpage is located at

www.blah.com/foo/foo2?variable=55

How would i obtain the URL of this page using a python function?

The function is called by:

<dtml-var test>

The syntax for "test" is rite, the Zope documentation says so.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烂柯人 2024-09-16 08:07:40

for: http://www.blah.com/foo/foo2?job_ID=55555&test=1

<dtml-var URL> = http://www.blah.com/foo/foo2

<dtml-var QUERY_STRING> = job_ID=55555&test=1

<dtml-var "REQUEST['job_ID']"> = 55555

See: http://wiki.zope.org/zope2/REQUESTX

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文