I'm feeling a bit confused about how to retrieve data from my backend model and display it on my website. For instance, I'm using a drag-and-drop component provided by the website's model. How can I display data from my custom model, like images, in a carousel on the website? Additionally, I'd like to know how to submit a website form and insert the submitted data into my custom model. Any guidance would be greatly appreciated!
Well , I'm trying to create a fully customized page for the user .
In your custom (overriden) controller you can return request.render("a-model.view-key", data), in order to send your custom model data to the website template "a-model.view-key"... see the official website_blog addon as example:
website_blog/controllers/main.py
This controller-def returns the xml-template "blog_post_complete" (and inject its values: blog, tags, next_post...) which is located in the module "website_blog" under views/website_blog_templates.xml:
To display your custom model field, you can inherit the controller and override its def AND extend the view (using inherit_id)...