Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/async_storages/integrations/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class FileType(TypeDecorator[Any]):
"""
SQLAlchemy column type for representing stored files.

This type integrates with :class:`~async_storages.base.BaseStorage`
This type integrates with :class:`~async_storages.BaseStorage`
to automatically wrap database values (file names) into
:class:`~async_storages.StorageFile` objects when queried.

Expand All @@ -34,9 +34,9 @@ def process_bind_param(self, value: Any, dialect: Dialect) -> str:
if isinstance(value, str):
return value

name = getattr(value, "name", None)
if name:
return name
filename = getattr(value, "filename", None)
if filename:
return filename
return str(value)

@override
Expand All @@ -56,7 +56,7 @@ class ImageType(FileType):
database values (image file names) into
:class:`~async_storages.StorageImage` objects when queried.

It integrates with a configured :class:`~async_storages.base.BaseStorage`
It integrates with a configured :class:`~async_storages.BaseStorage`
backend to provide convenient access to image operations such as
resizing, thumbnail generation, or metadata retrieval.

Expand All @@ -69,7 +69,7 @@ class ImageType(FileType):
@override
def process_result_value(
self, value: Any | None, dialect: Dialect
) -> StorageFile | None:
) -> StorageImage | None:
if value is None:
return None
return StorageImage(name=value, storage=self.storage)