Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

214 строки
9.9 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>profile — Profile &mdash; Documentation</title>
  7. <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '',
  12. VERSION: '',
  13. COLLAPSE_MODINDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/doctools.js"></script>
  20. <link rel="top" title="Documentation" href="index.html" />
  21. <link rel="up" title="3. Server Side API" href="server_side_api.html" />
  22. <link rel="next" title="webservice — Remote Framework Access via HTTP" href="webservice.html" />
  23. <link rel="prev" title="email_lib — Email" href="email_lib.html" />
  24. </head>
  25. <body>
  26. <div style="background-color: #FFF; text-align: left; padding: 8px 0px"><img src="_static/banner300910.gif"></div>
  27. <div class="related">
  28. <h3>Navigation</h3>
  29. <ul>
  30. <li class="right" style="margin-right: 10px">
  31. <a href="genindex.html" title="General Index"
  32. accesskey="I">index</a></li>
  33. <li class="right" >
  34. <a href="modindex.html" title="Global Module Index"
  35. accesskey="M">modules</a> |</li>
  36. <li class="right" >
  37. <a href="webservice.html" title="webservice — Remote Framework Access via HTTP"
  38. accesskey="N">next</a> |</li>
  39. <li class="right" >
  40. <a href="email_lib.html" title="email_lib — Email"
  41. accesskey="P">previous</a> |</li>
  42. <li><a href="index.html">Documentation</a> &raquo;</li>
  43. <li><a href="server_side_api.html" accesskey="U">3. Server Side API</a> &raquo;</li>
  44. </ul>
  45. </div>
  46. <div class="sphinxsidebar">
  47. <div class="sphinxsidebarwrapper">
  48. <h3><a href="index.html">Table Of Contents</a></h3>
  49. <ul>
  50. <li><a class="reference external" href=""><tt class="docutils literal"><span class="pre">profile</span></tt> &#8212; Profile</a><ul>
  51. <li><a class="reference external" href="#profile-object">Profile object</a></li>
  52. </ul>
  53. </li>
  54. </ul>
  55. <h4>Previous topic</h4>
  56. <p class="topless"><a href="email_lib.html"
  57. title="previous chapter"><tt class="docutils literal docutils literal"><span class="pre">email_lib</span></tt> &#8212; Email</a></p>
  58. <h4>Next topic</h4>
  59. <p class="topless"><a href="webservice.html"
  60. title="next chapter"><tt class="docutils literal"><span class="pre">webservice</span></tt> &#8212; Remote Framework Access via HTTP</a></p>
  61. <h3>This Page</h3>
  62. <ul class="this-page-menu">
  63. <li><a href="_sources/profile.txt"
  64. rel="nofollow">Show Source</a></li>
  65. </ul>
  66. <div id="searchbox" style="display: none">
  67. <h3>Quick search</h3>
  68. <form class="search" action="search.html" method="get">
  69. <input type="text" name="q" size="18" />
  70. <input type="submit" value="Go" />
  71. <input type="hidden" name="check_keywords" value="yes" />
  72. <input type="hidden" name="area" value="default" />
  73. </form>
  74. <p class="searchtip" style="font-size: 90%">
  75. Enter search terms or a module, class or function name.
  76. </p>
  77. </div>
  78. <script type="text/javascript">$('#searchbox').show(0);</script>
  79. </div>
  80. </div>
  81. <div class="document">
  82. <div class="documentwrapper">
  83. <div class="bodywrapper">
  84. <div class="body">
  85. <div class="section" id="profile-profile">
  86. <h1><tt class="xref docutils literal"><span class="pre">profile</span></tt> &#8212; Profile<a class="headerlink" href="#profile-profile" title="Permalink to this headline">¶</a></h1>
  87. <div class="section" id="profile-object">
  88. <h2>Profile object<a class="headerlink" href="#profile-object" title="Permalink to this headline">¶</a></h2>
  89. <dl class="class">
  90. <dt id="Profile">
  91. <em class="property">class </em><tt class="descname">Profile</tt><big>(</big><em>self</em>, <em>name</em><big>)</big><a class="headerlink" href="#Profile" title="Permalink to this definition">¶</a></dt>
  92. <dd><p>A profile object is created at the beginning of every request with details of the use.
  93. The global profile object is <cite>webnotes.user</cite></p>
  94. <dl class="attribute">
  95. <dt id="Profile.roles">
  96. <tt class="descname">roles</tt><a class="headerlink" href="#Profile.roles" title="Permalink to this definition">¶</a></dt>
  97. <dd>list of roles assigned including &#8216;All&#8217; (for logged user) or &#8216;Guest&#8217; for not logged user</dd></dl>
  98. <dl class="attribute">
  99. <dt id="Profile.can_create">
  100. <tt class="descname">can_create</tt><a class="headerlink" href="#Profile.can_create" title="Permalink to this definition">¶</a></dt>
  101. <dd>list of DocTypes the user can create</dd></dl>
  102. <dl class="attribute">
  103. <dt id="Profile.can_read">
  104. <tt class="descname">can_read</tt><a class="headerlink" href="#Profile.can_read" title="Permalink to this definition">¶</a></dt>
  105. <dd>list of DocTypes the user can read</dd></dl>
  106. <dl class="attribute">
  107. <dt id="Profile.can_write">
  108. <tt class="descname">can_write</tt><a class="headerlink" href="#Profile.can_write" title="Permalink to this definition">¶</a></dt>
  109. <dd>list of DocTypes the user can edit</dd></dl>
  110. <dl class="method">
  111. <dt id="Profile.get_roles">
  112. <tt class="descname">get_roles</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_roles" title="Permalink to this definition">¶</a></dt>
  113. <dd>get list of roles</dd></dl>
  114. <dl class="method">
  115. <dt id="Profile.get_allow_list">
  116. <tt class="descname">get_allow_list</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#Profile.get_allow_list" title="Permalink to this definition">¶</a></dt>
  117. <dd>internal - get list of DocType where <cite>key</cite> is allowed. Key is either &#8216;read&#8217;, &#8216;write&#8217; or &#8216;create&#8217;</dd></dl>
  118. <dl class="method">
  119. <dt id="Profile.get_create_list">
  120. <tt class="descname">get_create_list</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_create_list" title="Permalink to this definition">¶</a></dt>
  121. <dd>get list of DocTypes the user can create. Will filter DocTypes tagged with &#8216;not_in_create&#8217; and table</dd></dl>
  122. <dl class="method">
  123. <dt id="Profile.get_read_list">
  124. <tt class="descname">get_read_list</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_read_list" title="Permalink to this definition">¶</a></dt>
  125. <dd>get list of DocTypes the user can read</dd></dl>
  126. <dl class="method">
  127. <dt id="Profile.get_write_list">
  128. <tt class="descname">get_write_list</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_write_list" title="Permalink to this definition">¶</a></dt>
  129. <dd>get list of DocTypes the user can write</dd></dl>
  130. <dl class="method">
  131. <dt>
  132. <tt class="descname">def get_home_page()</tt></dt>
  133. <dd>get the name of the user&#8217;s home page from the <cite>Control Panel</cite></dd></dl>
  134. <dl class="method">
  135. <dt id="Profile.get_defaults">
  136. <tt class="descname">get_defaults</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_defaults" title="Permalink to this definition">¶</a></dt>
  137. <dd>get the user&#8217;s default values based on user and role profile</dd></dl>
  138. <dl class="method">
  139. <dt id="Profile.get_random_password">
  140. <tt class="descname">get_random_password</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.get_random_password" title="Permalink to this definition">¶</a></dt>
  141. <dd>generate a random password</dd></dl>
  142. <dl class="method">
  143. <dt>
  144. <tt class="descname">reset_password():</tt></dt>
  145. <dd>reset the user&#8217;s password and send an email</dd></dl>
  146. <dl class="method">
  147. <dt id="Profile.update_recent">
  148. <tt class="descname">update_recent</tt><big>(</big><em>dt</em>, <em>dn</em><big>)</big><a class="headerlink" href="#Profile.update_recent" title="Permalink to this definition">¶</a></dt>
  149. <dd>update the user&#8217;s <cite>Recent</cite> list with the given <cite>dt</cite> and <cite>dn</cite></dd></dl>
  150. <dl class="method">
  151. <dt id="Profile.load_profile">
  152. <tt class="descname">load_profile</tt><big>(</big><big>)</big><a class="headerlink" href="#Profile.load_profile" title="Permalink to this definition">¶</a></dt>
  153. <dd>return a dictionary of user properites to be stored in the session</dd></dl>
  154. <dl class="method">
  155. <dt>
  156. <tt class="descname">load_from_session(self):</tt></dt>
  157. <dd>setup the user profile from the dictionary saved in the session (generated by <cite>load_profile</cite>)</dd></dl>
  158. </dd></dl>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="clearer"></div>
  165. </div>
  166. <div class="related">
  167. <h3>Navigation</h3>
  168. <ul>
  169. <li class="right" style="margin-right: 10px">
  170. <a href="genindex.html" title="General Index"
  171. >index</a></li>
  172. <li class="right" >
  173. <a href="modindex.html" title="Global Module Index"
  174. >modules</a> |</li>
  175. <li class="right" >
  176. <a href="webservice.html" title="webservice — Remote Framework Access via HTTP"
  177. >next</a> |</li>
  178. <li class="right" >
  179. <a href="email_lib.html" title="email_lib — Email"
  180. >previous</a> |</li>
  181. <li><a href="index.html">Documentation</a> &raquo;</li>
  182. <li><a href="server_side_api.html" >3. Server Side API</a> &raquo;</li>
  183. </ul>
  184. </div>
  185. <div class="footer">
  186. &copy; Copyright 2010, Rushabh Mehta.
  187. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
  188. </div>
  189. </body>
  190. </html>