You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
4.3 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <section class="oe_container">
  2. <div class="oe_row oe_spaced">
  3. <h2 class="oe_slogan">MuK PGSQL Large Objects</h2>
  4. <h3 class="oe_slogan">PGSQL Large Objects Support</h3>
  5. <h4 class="oe_slogan" style="font-size: 23px;">MuK IT GmbH -
  6. www.mukit.at</h4>
  7. </div>
  8. </section>
  9. <section class="oe_container">
  10. <div class="oe_row oe_spaced">
  11. <div style="max-width: 84%; margin: 16px 8%;">
  12. <h3 class="oe_slogan">Overview</h3>
  13. <div class="oe_mt32"
  14. style="padding-bottom: 10px; text-align: justify;">
  15. <p>Provides a field to store bytes as PostgreSQL large objects.
  16. PostgreSQL offers support for large objects, which provide
  17. stream-style access to user data that is stored in a special
  18. large-object structure. They are useful with data values too large
  19. to be manipulated conveniently as a whole.</p>
  20. <h5 style="padding-top: 10px;">Psycopg2 for Python</h5>
  21. <p>
  22. Psycopg allows access to the large object using the
  23. <code>lobject</code>
  24. class. Objects are generated using the
  25. <code>connection.lobject()</code>
  26. factory method. Data can be retrieved either as bytes or as Unicode
  27. strings.
  28. </p>
  29. <p>
  30. Psycopg large object support efficient import/export with file
  31. system files using the
  32. <code>lo_import()</code>
  33. and
  34. <code>lo_export()</code>
  35. libpq functions.
  36. </p>
  37. <p>Changed in version 2.6: added support for large objects
  38. greated than 2GB. Note that the support is enabled only if all the
  39. following conditions are verified:</p>
  40. <ul>
  41. <li>the Python build is 64 bits;</li>
  42. <li>the extension was built against at least libpq 9.3;</li>
  43. <li>the server version is at least PostgreSQL 9.3
  44. (server_version must be >= 90300).</li>
  45. </ul>
  46. <p>
  47. If Psycopg was built with 64 bits large objects support (i.e. the
  48. first two contidions above are verified), the
  49. <code>psycopg2.__version__</code>
  50. constant will contain the lo64 flag. If any of the contition is not
  51. met several lobject methods will fail if the arguments exceed 2GB.
  52. </p>
  53. </div>
  54. <pre>
  55. <code>
  56. from odoo.addons.muk_fields_lobject.fields import LargeObject
  57. class LargeObjectModel(models.Model):
  58. data_content = LargeObject(string="Data")
  59. @api.multi
  60. def data(self):
  61. for record in self:
  62. bytes = record.data_content
  63. oid = record.with_context({'oid': True}).data_content
  64. size = record.with_context({'bin_size': True}).data_content
  65. stream = record.with_context({'stream': True}).data_content
  66. </code>
  67. </pre>
  68. </div>
  69. </div>
  70. </section>
  71. <section class="oe_container oe_dark"
  72. style="margin-bottom: 20px; border-top: 5px solid #797979; border-bottom: 5px solid #797979;">
  73. <h3 class="oe_slogan" style="margin-bottom: 10px;">Demo</h3>
  74. <div class="row" style="margin: auto; max-width: 200px;">
  75. <div class="col-xs-6">
  76. <h5 class="oe_slogan" style="font-size: 20px; margin: 2px;">User:</h5>
  77. </div>
  78. <div class="col-xs-6">
  79. <h5 class="oe_slogan" style="font-size: 20px; margin: 2px;">apps</h5>
  80. </div>
  81. <div class="col-xs-6">
  82. <h5 class="oe_slogan" style="font-size: 20px; margin: 2px;">Password:</h5>
  83. </div>
  84. <div class="col-xs-6">
  85. <h5 class="oe_slogan" style="font-size: 20px; margin: 2px;">demo</h5>
  86. </div>
  87. </div>
  88. <div class="oe_slogan" style="margin-top: 5px;">
  89. <a class="btn btn-primary btn-lg mt8" href="https://demo.mukit.at/web/login"
  90. style="position: relative; overflow: hidden;"><span
  91. class="o_ripple"
  92. style="height: 138px; width: 138px; top: -35.2969px; left: -8.17188px;"></span>
  93. <i class="fa fa-video-camera"></i> Live Preview </a>
  94. </div>
  95. </section>
  96. <section class="oe_container oe_dark">
  97. <h3 class="oe_slogan">Help and Support</h3>
  98. <h5 class="oe_slogan" style="font-size: 20px;">Feel free to
  99. contact us, if you need any help with your Odoo integration or addiontal
  100. features.</h5>
  101. <div class="oe_slogan">
  102. <a class="btn btn-primary btn-lg mt8" href="mailto:sale@mukit.at">
  103. <i class="fa fa-envelope"></i> Email
  104. </a> <a class="btn btn-primary btn-lg mt8"
  105. href="https://mukit.at/page/contactus"> <i class="fa fa-phone"></i>
  106. Contact
  107. </a> <a class="btn btn-primary btn-lg mt8" href="mailto:support@mukit.at">
  108. <i class="fa fa-life-ring"></i> Support
  109. </a>
  110. </div>
  111. <img src="logo.png" style="width: 200px; margin-bottom: 20px;"
  112. class="center-block">
  113. </section>