Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

143 Zeilen
6.6 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>Database API Functions &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="doc — Document (ORM)" href="doc.html" />
  23. <link rel="prev" title="3. Server Side API" href="server_side_api.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="doc.html" title="doc — Document (ORM)"
  38. accesskey="N">next</a> |</li>
  39. <li class="right" >
  40. <a href="server_side_api.html" title="3. Server Side API"
  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. <h4>Previous topic</h4>
  49. <p class="topless"><a href="server_side_api.html"
  50. title="previous chapter">3. Server Side API</a></p>
  51. <h4>Next topic</h4>
  52. <p class="topless"><a href="doc.html"
  53. title="next chapter"><tt class="docutils literal"><span class="pre">doc</span></tt> &#8212; Document (ORM)</a></p>
  54. <h3>This Page</h3>
  55. <ul class="this-page-menu">
  56. <li><a href="_sources/database_api.txt"
  57. rel="nofollow">Show Source</a></li>
  58. </ul>
  59. <div id="searchbox" style="display: none">
  60. <h3>Quick search</h3>
  61. <form class="search" action="search.html" method="get">
  62. <input type="text" name="q" size="18" />
  63. <input type="submit" value="Go" />
  64. <input type="hidden" name="check_keywords" value="yes" />
  65. <input type="hidden" name="area" value="default" />
  66. </form>
  67. <p class="searchtip" style="font-size: 90%">
  68. Enter search terms or a module, class or function name.
  69. </p>
  70. </div>
  71. <script type="text/javascript">$('#searchbox').show(0);</script>
  72. </div>
  73. </div>
  74. <div class="document">
  75. <div class="documentwrapper">
  76. <div class="bodywrapper">
  77. <div class="body">
  78. <div class="section" id="database-api-functions">
  79. <h1>Database API Functions<a class="headerlink" href="#database-api-functions" title="Permalink to this headline">¶</a></h1>
  80. <p>Common Database functions. These are a part of the <a title="Database Module" class="reference external" href="db.html#module-db"><tt class="xref docutils literal"><span class="pre">db</span></tt></a> Module and reproduced here because these are
  81. global and used in API</p>
  82. <dl class="function">
  83. <dt id="sql">
  84. <tt class="descname">sql</tt><big>(</big><em>query</em>, <em>values=()</em>, <em>as_dict = 0</em>, <em>as_list = 0</em>, <em>allow_testing = 1</em><big>)</big><a class="headerlink" href="#sql" title="Permalink to this definition">¶</a></dt>
  85. <dd><ul class="simple">
  86. <li>Execute a <cite>query</cite>, with given <cite>values</cite></li>
  87. <li>returns as a dictionary if as_dict = 1</li>
  88. <li>returns as a list of lists (with cleaned up dates and decimals) if as_list = 1</li>
  89. </ul>
  90. </dd></dl>
  91. <dl class="function">
  92. <dt id="convert_to_lists">
  93. <tt class="descname">convert_to_lists</tt><big>(</big><em>res</em><big>)</big><a class="headerlink" href="#convert_to_lists" title="Permalink to this definition">¶</a></dt>
  94. <dd>Convert the given result set to a list of lists (with cleaned up dates and decimals)</dd></dl>
  95. <dl class="function">
  96. <dt id="get_value">
  97. <tt class="descname">get_value</tt><big>(</big><em>dt</em>, <em>dn</em>, <em>fieldname</em><big>)</big><a class="headerlink" href="#get_value" title="Permalink to this definition">¶</a></dt>
  98. <dd>Return the value of the given field in the given record. For Single Type, set dn = None</dd></dl>
  99. <dl class="function">
  100. <dt id="set">
  101. <tt class="descname">set</tt><big>(</big><em>doc</em>, <em>field</em>, <em>val</em><big>)</big><a class="headerlink" href="#set" title="Permalink to this definition">¶</a></dt>
  102. <dd>Set a field value in the <a title="doc.Document" class="reference external" href="doc.html#doc.Document"><tt class="xref docutils literal"><span class="pre">doc.Document</span></tt></a> and upate it in the Database.</dd></dl>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="clearer"></div>
  108. </div>
  109. <div class="related">
  110. <h3>Navigation</h3>
  111. <ul>
  112. <li class="right" style="margin-right: 10px">
  113. <a href="genindex.html" title="General Index"
  114. >index</a></li>
  115. <li class="right" >
  116. <a href="modindex.html" title="Global Module Index"
  117. >modules</a> |</li>
  118. <li class="right" >
  119. <a href="doc.html" title="doc — Document (ORM)"
  120. >next</a> |</li>
  121. <li class="right" >
  122. <a href="server_side_api.html" title="3. Server Side API"
  123. >previous</a> |</li>
  124. <li><a href="index.html">Documentation</a> &raquo;</li>
  125. <li><a href="server_side_api.html" >3. Server Side API</a> &raquo;</li>
  126. </ul>
  127. </div>
  128. <div class="footer">
  129. &copy; Copyright 2010, Rushabh Mehta.
  130. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
  131. </div>
  132. </body>
  133. </html>