Image#
- class ansys.dynamicreporting.core.serverless.item.Image(*args, **kwargs)#
Bases:
FilePayloadMixin,ItemItem representing an image payload, optionally enhanced.
Methods
Image.add_tag(tag[, value])Add or update a single tag.
Image.as_dict([recursive])Serialize the model into a plain dictionary.
Image.create(**kwargs)Factory-style creation that dispatches to the correct subclass.
Delete the payload file and then the ORM instance.
Image.filter(**kwargs)Return a collection of items, scoped by subclass type.
Image.find([query])Search for items using an ADR query string.
Image.get(**kwargs)Retrieve a single item instance, scoped by subclass type.
Return the raw tag string stored on this object.
Reset the in-memory ORM state for this object.
Image.rem_tag(tag)Remove a tag by key, if it exists.
Image.remove_tag(tag)Alias for
rem_tag()for backwards compatibility.Image.render(*[, context, request])Render the item as HTML.
Image.save(**kwargs)Save the image payload, converting to PNG when appropriate.
Image.set_tags(tag_str)Replace all tags with the given tag string.
Attributes
Validated image file content for this item.
Dataset associated with this item.
Database alias in which this object is stored.
Whether this image is an enhanced image (for example TIFF with metadata).
File extension of the payload file, without the leading dot.
Absolute path to the payload file, if available.
Whether a payload file exists on disk.
Image height in pixels.
Human-readable name for the item.
Whether this object has been successfully saved to the database.
Sequence index for ordering items within a dataset/session.
Session that owns this item.
Optional free-form source identifier for this item.
Tag string used to group and filter objects.
Item type identifier for image items.
Image width in pixels.
Timestamp when the item was created.
Globally unique identifier for this object.
- exception DoesNotExist(extra_detail: str = None)#
Bases:
DoesNotExist
- exception IntegrityError(extra_detail: str = None)#
Bases:
IntegrityError
- exception MultipleObjectsReturned(extra_detail: str = None)#
Bases:
MultipleObjectsReturned
- content: ImageContent = None#
Validated image file content for this item.
- property enhanced#
Whether this image is an enhanced image (for example TIFF with metadata).
- property height#
Image height in pixels.
- save(**kwargs)#
Save the image payload, converting to PNG when appropriate.
Non-enhanced images are stored as PNG files, while enhanced images retain their original format. The file name is derived from the item GUID.
- Parameters:
- **kwargs
Keyword arguments forwarded to the database
savemethod of the underlying ORM instance. For eg: Theusingargument can be used to select the target database alias.
- Raises:
IntegrityErrorIf the database reports an integrity violation while saving.
InvalidFieldErrorIf invalid field names or values are supplied (via decorator).
ADRExceptionIf an error occurs during image conversion.
ExceptionAny other unexpected exception is propagated unchanged.
- property width#
Image width in pixels.