表示内部或外部链接的链接架构类型。
collective.formlib.link的Python项目详细描述
概述
此包提供了一个模式字段,该字段将 外部链接表示。技术含量相对较低。
它提供了一个小部件,允许用户以以下格式输入链接:
``"Title":internal path or URI:"Description"``
标题和描述都是可选的。如果给定了内部路径, 该字段尝试解析对象并仅存储其uid。
要求
- Zope 2.10.4+
用法
包含包的zcml slug,以便将小部件注册到 表单库。
包含单个链接的字段的架构定义:
>>> from collective.formlib.link.field import Link >>> field = Link(title=u"Link")
链接字段列表:
>>> from zope import schema >>> field = schema.List( ... title=u"Links", ... value_type=Link)
从页面模板呈现链接:
<a tal:attributes="href link/@@absolute_url; title link/description" tal:content="link/pretty_title_or_uri" />
释放量
0.2(2011-07-01)
- 修复了链接打包例程的问题。 [马尔特]
0.1(2008-02-29)
- 首次公开发行。