Skip to content

Rename time information APIs to be Django-compliant #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brianhelba
Copy link
Collaborator

The following MinioStorage methods are renamed:

  • accessed_time -> get_accessed_time
  • created_time -> get_created_time
  • modified_time -> get_modified_time

Additionally, get_accessed_time and get_created_time now raise NotImplementedError, as this information is not available from Minio.

See:
https://docs.djangoproject.com/en/5.2/ref/files/storage/#django.core.files.storage.Storage.get_accessed_time https://docs.djangoproject.com/en/5.2/ref/files/storage/#django.core.files.storage.Storage.get_created_time https://docs.djangoproject.com/en/5.2/ref/files/storage/#django.core.files.storage.Storage.get_accessed_time

Fixes #83.

@brianhelba
Copy link
Collaborator Author

This is a breaking change, but it does make MinioStorage compliant with the upstream Django Storage API. Otherwise, the current behavior is incorrect.

I'm fine to wait indefinitely before merging this, if compatibility is a concern.

@brianhelba brianhelba added the v0.6 breaking changes label May 8, 2025
@brianhelba brianhelba requested a review from thomasf May 8, 2025 14:50
The following `MinioStorage` methods are renamed:
* `accessed_time` -> `get_accessed_time`
* `created_time` -> `get_created_time`
* `modified_time` -> `get_modified_time`

Additionally, `get_accessed_time` and `get_created_time` now raise
`NotImplementedError`, as this information is not available from Minio.

See:
https://docs.djangoproject.com/en/5.2/ref/files/storage/#django.core.files.storage.Storage.get_accessed_time
https://docs.djangoproject.com/en/5.2/ref/files/storage/#django.core.files.storage.Storage.get_created_time
https://docs.djangoproject.com/en/5.2/ref/files/storage/#django.core.files.storage.Storage.get_accessed_time

Fixes py-pa#83.
@thomasf
Copy link
Collaborator

thomasf commented May 10, 2025

maybe we can the old methods and document that the old ones are deprecated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.6 breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider not supporting accessed_time and created_time Storage methods
2 participants