📄 api参考.htm
字号:
font-size:10.0pt; font-family:"Times New Roman";}</style><![endif]--></HEAD>
<BODY lang=ZH-CN style="TEXT-JUSTIFY-TRIM: punctuation; tab-interval: 21.0pt">
<DIV class=Section1 style="LAYOUT-GRID-LINE: 15.6pt">
<H1 align=center style="TEXT-ALIGN: center"><SPAN lang=EN-US>API</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">参考</SPAN></H1>
<P class=MsoNormal><B style="mso-bidi-font-weight: normal"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">提供者:</SPAN><SPAN
lang=EN-US>Python</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">世界:杜文山</SPAN>
</B><SPAN class=GramE><B style="mso-bidi-font-weight: normal"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(</SPAN></B></SPAN><B
style="mso-bidi-font-weight: normal"><SPAN
lang=EN-US>http://www.dohao.org/python</SPAN></B><B
style="mso-bidi-font-weight: normal"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)</SPAN></B><SPAN
lang=EN-US style="FONT-FAMILY: Helvetica"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN
lang=EN-US style="FONT-FAMILY: Helvetica"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: Helvetica; mso-hansi-font-family: Helvetica">这个文档描述了基础</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: Helvetica">Zope</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: Helvetica; mso-hansi-font-family: Helvetica">对象集里的最常用接口。这些参考用于编写</SPAN><SPAN
lang=EN-US>DTML</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: Helvetica; mso-hansi-font-family: Helvetica">、</SPAN><SPAN
lang=EN-US>Perl</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: Helvetica; mso-hansi-font-family: Helvetica">和</SPAN><SPAN
lang=EN-US>Python</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: Helvetica; mso-hansi-font-family: Helvetica">脚本,而这些脚本可以创建和操纵</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: Helvetica">Zope</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: Helvetica; mso-hansi-font-family: Helvetica">对象。</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: Helvetica"><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN lang=EN-US
style="FONT-FAMILY: Helvetica"><o:p> </o:p></SPAN></P>
<H2><SPAN
style="FONT-FAMILY: 黑体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">1.</SPAN><I><SPAN
lang=EN-US
style="FONT-FAMILY: 'Times New Roman'">AuthenticatedUser</SPAN></I><SPAN
lang=EN-US style="FONT-FAMILY: 'Times New Roman'"> </SPAN><SPAN
style="FONT-FAMILY: 黑体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: 'Times New Roman'"><o:p></o:p></SPAN></H2>
<P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这个接口需要由用户确认后返回的对象来提供支持,并且这个接口用于访问控制。</SPAN></P>
<P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN class=GramE><B><I><SPAN
lang=EN-US>getUserName()</SPAN></I></B></SPAN><B><I><SPAN
lang=EN-US><o:p></o:p></SPAN></I></B></P>
<P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">返回用户名称</SPAN></P>
<P class=MsoNormal
style="MARGIN-LEFT: 59.55pt; TEXT-INDENT: -19.85pt; mso-list: l48 level1 lfo107; tab-stops: list 59.55pt"><![if !supportLists]><SPAN
lang=EN-US
style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN
style="mso-list: Ignore">l<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">许可</SPAN><SPAN
lang=EN-US>——Always available</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(总是存在)</SPAN></P>
<P class=MsoNormal><SPAN class=GramE><B><I><SPAN
lang=EN-US>getId()</SPAN></I></B></SPAN><B><I><SPAN
lang=EN-US><o:p></o:p></SPAN></I></B></P>
<P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">取得用户的</SPAN><SPAN
lang=EN-US>ID</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</SPAN><SPAN
lang=EN-US>ID</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">可以被用来(至少在</SPAN><SPAN
lang=EN-US>Python</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中)从用户的</SPAN><SPAN
lang=EN-US>UserDatabase</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中得到用户。</SPAN></P>
<P class=MsoNormal
style="MARGIN-LEFT: 59.55pt; TEXT-INDENT: -19.85pt; mso-list: l48 level1 lfo107; tab-stops: list 59.55pt"><![if !supportLists]><SPAN
lang=EN-US
style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN
style="mso-list: Ignore">l<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">许可</SPAN><SPAN
lang=EN-US>——Python only</SPAN><SPAN class=GramE><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(</SPAN></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">只有</SPAN><SPAN
lang=EN-US>Python</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)</SPAN></P>
<P class=MsoNormal><SPAN class=GramE><B><I><SPAN
lang=EN-US>getDatabasePath()</SPAN></I></B></SPAN><B><I><SPAN
lang=EN-US><o:p></o:p></SPAN></I></B></P>
<P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">取得用户的</SPAN><SPAN
lang=EN-US>UserDatabase</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的物理路径。通过这个方法返回的路径,可以方便的用来取得用户数据库。</SPAN></P>
<P class=MsoNormal
style="MARGIN-LEFT: 59.55pt; TEXT-INDENT: -19.85pt; mso-list: l48 level1 lfo107; tab-stops: list 59.55pt"><![if !supportLists]><SPAN
lang=EN-US
style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN
style="mso-list: Ignore">l<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">许可</SPAN><SPAN
lang=EN-US>——Python only</SPAN><SPAN class=GramE><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(</SPAN></SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">只有</SPAN><SPAN
lang=EN-US>Python</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">)</SPAN></P>
<P class=MsoNormal><SPAN class=GramE><B><I><SPAN
lang=EN-US>hasRole(</SPAN></I></B></SPAN><B><I><SPAN lang=EN-US>object,
roles)<o:p></o:p></SPAN></I></B></P>
<P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">返回一个值,如果用户对于给定的对象拥有给定的角色,<SPAN
class=GramE>这个值才为</SPAN>真值,否则,它返回一个假值。</SPAN></P>
<P class=MsoNormal
style="MARGIN-LEFT: 59.55pt; TEXT-INDENT: -19.85pt; mso-list: l48 level1 lfo107; tab-stops: list 59.55pt"><![if !supportLists]><SPAN
lang=EN-US
style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN
style="mso-list: Ignore">l<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">许可</SPAN><SPAN
lang=EN-US>——Always available</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(总是存在)</SPAN></P>
<P class=MsoNormal><SPAN class=GramE><B><I><SPAN
lang=EN-US>getRoles()</SPAN></I></B></SPAN><B><I><SPAN
lang=EN-US><o:p></o:p></SPAN></I></B></P>
<P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt; mso-char-indent-count: 2.0"><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">返回用户在给定的</SPAN><SPAN
lang=EN-US>object</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象上的角色列表。</SPAN></P>
<P class=MsoNormal
style="MARGIN-LEFT: 59.55pt; TEXT-INDENT: -19.85pt; mso-list: l48 level1 lfo107; tab-stops: list 59.55pt"><![if !supportLists]><SPAN
lang=EN-US
style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN
style="mso-list: Ignore">l<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN></SPAN><![endif]><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">许可</SPAN><SPAN
lang=EN-US>——Always available</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">(总是存在)</SPAN></P>
<P class=MsoNormal style="MARGIN-LEFT: 39.7pt"><SPAN
lang=EN-US><o:p> </o:p></SPAN></P>
<H2><SPAN
style="FONT-FAMILY: 黑体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">2.</SPAN><I><SPAN
lang=EN-US
style="FONT-FAMILY: 'Times New Roman'">DTMLDocument(ObjectManagerItem,
PropertyManager) </SPAN></I><SPAN
style="FONT-FAMILY: 黑体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">类</SPAN><SPAN
lang=EN-US style="FONT-FAMILY: 'Times New Roman'"><o:p></o:p></SPAN></H2>
<P class=MsoNormal><SPAN lang=EN-US><o:p> </o:p></SPAN></P>
<P class=MsoNormal><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一个</SPAN><SPAN
lang=EN-US>DTML</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文档是一个包含和执行</SPAN><SPAN
lang=EN-US>DTML</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">代码的</SPAN><SPAN
lang=EN-US>Zope</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对象。它用于呈现</SPAN><SPAN
lang=EN-US>Web</SPAN><SPAN
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">页面。</SPAN></P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -