Search 1.9 billion lines of Odoo code on GitHub

cms_mixin

Author: Camptocamp, Odoo Community Association (OCA)
License: LGPL-3
Branch: 11-add-mixin
Repository: simahawk/website-cms
Dependencies: cms_delete_content, and website
Languages: Python (259, 81.7%), and reStructuredText (58, 18.3%)
Other branches: add-mixins

<a class="reference external image-reference" href="http://www.gnu.org/licenses/LGPL-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-lgpl--3-blue.png" /></a> <a name="cms-mixin"></a> <h2>CMS mixin</h2> <p>Base behaviors for CMS contents.</p> <p>Provided mixins:</p> <ul class="simple"> <li><code>cms.orderable.mixin</code></li> <li><code>cms.coremetadata.mixin</code></li> <li><code>cms.content.mixin</code></li> </ul> <a name="orderable-mixin"></a> <h3>Orderable mixin</h3> <p>Implements basic ordering features:</p> <ul class="simple"> <li>order model by <cite>sequence desc</cite> by default</li> <li>last created item has always higher sequence</li> </ul> <p>Usage:</p> <pre> <code lang="python">class OrderableModel(models.Model): _name = 'my.orderable' _inherit = [ 'website.published.mixin', 'cms.orderable.mixin', ]</code> </pre> <a name="coremetadata-mixin"></a> <h3>Coremetadata mixin</h3> <p>Implements basic core metadata features:</p> <ul> <li><p class="first">exposes create/write fields:</p> <blockquote> <p><cite>create_uid</cite>, <cite>write_uid</cite>, <cite>create_date</cite>, <cite>write_date</cite></p> </blockquote> <p>so that you can use them directly in views and forms</p> </li> <li><p class="first">adds new fields:</p> <blockquote> <ul class="simple"> <li><cite>publish_uid</cite> to track who published an item</li> <li><cite>publish_date</cite> to track when an item has been published</li> </ul> </blockquote> </li> </ul> <p>Usage:</p> <pre> <code lang="python">class CoremetadataModel(models.Model): _name = 'my.coremetadata' _inherit = [ 'website.published.mixin', 'cms.coremetadata.mixin', ]</code> </pre> <a name="content-mixin"></a> <h3>Content mixin</h3> <p>Implements basic website content features:</p> <ul> <li><p class="first">uses following mixins by default:</p> <blockquote> <ul class="simple"> <li><code>website.published.mixin</code></li> <li><code>cms.coremetadata.mixin</code></li> <li><code>cms.orderable.mixin</code></li> </ul> </blockquote> </li> <li><p class="first">adds basic fields:</p> <blockquote> <ul class="simple"> <li><cite>name</cite></li> <li><cite>description</cite> brief description of the content</li> <li><cite>body</cite> to contain HTML content</li> </ul> </blockquote> </li> </ul> <p>Usage:</p> <pre> <code lang="python">class ContentModel(models.Model): _name = 'my.content' _inherit = [ 'cms.content.mixin', ]</code> </pre> <a name="bug-tracker"></a> <h4>Bug Tracker</h4> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/website-cms/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smash it by providing detailed and welcomed feedback.</p> <a name="credits"></a> <h4>Credits</h4> <a name="images"></a> <h3>Images</h3> <ul class="simple"> <li>Odoo Community Association: <a class="reference external" href="https://odoo-community.org/logo.png">Icon</a>.</li> </ul> <a name="contributors"></a> <h3>Contributors</h3> <ul class="simple"> <li>Simone Orsi &lt;<a class="reference external" href="mailto:simone.orsi&#64;camptocamp.com">simone.orsi&#64;camptocamp.com</a></li> </ul> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="maintainer"></a> <h3>Maintainer</h3> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>This module is maintained by the OCA.</p> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> <p>To contribute to this module, please visit <a class="reference external" href="https://odoo-community.org">https://odoo-community.org</a>.</p>