Skip to content

Latest commit

 

History

History

storyblok_base

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
License: GPL-3

Storyblok Base

Upload files to storyblok.

Configuration

  • Setup Storyblok API
  • Add Storyblok folder and connect with API and model

Once the asset field is updated, the file will be uploaded to Storyblok folder. The asset url and id are stored on the record as 'document_url' and storyblok_asset_id.

Usage

  • Inherit the Storyblok asset mixin in model with asset field:
class Partner(models.Model):
    _name = "res.partner"
    _inherit = ["res.partner", "storyblok.asset.mixin"]
  • Define an inverse method of the asset field:
image_1920 = fields.Image(inverse="_inverse_image_1920")

def _inverse_image_1920(self):
    self.upload_asset(self.image_1920)
  • To prevent upload use storyblok_update context.
self.with_context(storyblok_upload=False).write({"image_1920": filepath})

Maintainer

https://raw.githubusercontent.com/Mint-System/Wiki/master/assets/mint-system-logo.png

This module is maintained by Mint System GmbH.

For support and more information, please visit our Website.