_blobfields.py - Blob, Image, and File Field Management for ZMS
Blob fields are content attributes that store binary data (images, documents) within ZMS objects. This module provides the foundational classes and utilities for the entire blob field subsystem, enabling seamless integration of file uploads, secure access control, efficient HTTP delivery, and flexible storage backends.
License: GNU General Public License v2 or later, Organization: ZMS Publishing
| Class | |
Base class for binary large objects (blobs) stored in ZMS. |
| Class | |
Simple delegate wrapper for blob objects. |
| Class | |
Wrapper for external Zope file objects to provide blob-like interface. |
| Class | |
ZMS file blob class for managing binary and text files. |
| Class | |
ZMS image blob class for managing image files with metadata. |
| Function | bytes |
Convert binary or text data to a hexadecimal string. |
| Function | create |
Create a blob field instance and initialize it from uploaded data. |
| Function | get |
Append a language suffix to a filename when needed. |
| Function | recurse_download |
Export blob resources from the ZODB to the filesystem. |
| Function | rfc1123 |
Format a UNIX timestamp as an RFC 1123 HTTP date. |
| Function | thumbnail |
Generate a thumbnail image from one image attribute into another. |
| Function | thumbnail |
Generate configured thumbnail variants for all image fields. |
| Function | upload |
Build a blob field from raw uploaded content. |
Convert binary or text data to a hexadecimal string.
| Parameters | |
| data:bytes or str | Input data |
| Returns | |
| str | Hexadecimal representation |
Append a language suffix to a filename when needed.
| Parameters | |
| self | ZMS context object |
| filename:str | Original filename |
| lang:str | Language identifier |
| Returns | |
| str | Language-aware filename |
Export blob resources from the ZODB to the filesystem.
| Parameters | |
| self | ZMS context object |
| base | Export base path |
| REQUEST | Zope request object |
| Returns | |
| list | Exported resource metadata entries |
Format a UNIX timestamp as an RFC 1123 HTTP date.
| Parameters | |
| dt:float or int | Timestamp value |
| Returns | |
| str | RFC 1123 formatted date string |
Generate a thumbnail image from one image attribute into another.
| Parameters | |
| self | ZMS context object |
| hires | Source image attribute id |
| lores | Target image attribute id |
| maxdim:int | Maximum thumbnail dimension |
| lang:str | Language identifier |
| REQUEST | Zope request object |
| Returns | |
| str | Status message |
Generate configured thumbnail variants for all image fields.
| Parameters | |
| self | ZMS context object |
| lang:str | Language identifier |
| REQUEST | Zope request object |
| Returns | |
| str | Status message |