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.

23 lines
680 B

  1. This module just adds a technical utility, but nothing for the end user.
  2. If you are a developer and need this utility for your module, see these
  3. examples and read the docs inside the code.
  4. Python example::
  5. @api.multi
  6. def some_method(self):
  7. # Get images from an HTML field
  8. imgs = self.env["ir.fields.converter"].imgs_from_html(self.html_field)
  9. for url in imgs:
  10. # Do stuff with those URLs
  11. pass
  12. QWeb example::
  13. <!-- Extract first image from a blog post -->
  14. <t t-foreach="env['ir.fields.converter']
  15. .imgs_from_html(blog_post.content, 1)"
  16. t-as="url">
  17. <img t-att-href="url"/>
  18. </t>