# granite_storage.mixin

class granite_storage.mixin.ReplaceContentResult(previous_ref: 'StoredObjectRef | None', new_ref: 'StoredObjectRef')

  Bases: `object`

  __init__(previous_ref: StoredObjectRef | None, new_ref: StoredObjectRef) → None
  new_ref: StoredObjectRef
  previous_ref: StoredObjectRef | None

class granite_storage.mixin.StoredContentMixin

  Bases: `object`

  clear_content_reference() → StoredObjectRef | None
  classmethod configure_storage_manager(manager: StorageManager) → None
  get_content() → bytes | None
  get_content_text(encoding: str = 'utf-8') → str | None
  open_content() → BinaryIO | None
  replace_content(content: bytes | str, *, filename: str | None = None, content_type: str | None = None, storage_key: str | None = None, extra: dict[str, Any] | None = None) → ReplaceContentResult
  set_content(content: bytes | str, *, filename: str | None = None, content_type: str | None = None, storage_key: str | None = None, extra: dict[str, Any] | None = None) → StoredObjectRef
  set_content_from_stream(stream: BinaryIO, *, filename: str | None = None, content_type: str | None = None, storage_key: str | None = None, extra: dict[str, Any] | None = None) → StoredObjectRef
  async set_content_from_uploadfile(upload_file: UploadFile, *, storage_key: str | None = None, extra: dict[str, Any] | None = None) → StoredObjectRef