Skip to content

Commit 3ec56fd

Browse files
committed
describe how to use NamedBlobImage
1 parent 12ec16b commit 3ec56fd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/backend/fields.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,25 @@ See [`plone.namedfile`](https://pypi.org/project/plone.namedfile/) and [plone.fo
103103
| `NamedBlobFile` | `NamedBlobFile` | A binary uploaded file stored as a ZODB blob. Requires the `blobs` extra to `plone.namedfile`. Otherwise identical to `NamedFile`. | `IField` |
104104
| `NamedBlobImage` | `NamedBlobImage` | A binary uploaded image stored as a ZODB blob. Requires the `blobs` extra to `plone.namedfile`. Otherwise identical to `NamedImage`. | `IField` |
105105

106+
#### NamedBlobImage
107+
108+
The following example shows, how to create an Image object and attach the image file to it.
109+
110+
```python
111+
img_obj = api.content.create(
112+
container=ww_article,
113+
type="Image",
114+
id="test.jpg",
115+
)
116+
img_obj.image = NamedBlobImage(
117+
data=img_file,
118+
filename="test.jpg",
119+
)
120+
```
121+
122+
123+
124+
106125

107126
### Fields in `z3c.relationfield.schema`
108127

0 commit comments

Comments
 (0)