Skip to content

Commit

Permalink
Version bumped to 1.0.0:
Browse files Browse the repository at this point in the history
  * path() raise error text updated
  * get_accessed_time now raise NotImplementedError
  * get_created_time now raise NotImplementedError
  • Loading branch information
theriverman committed Sep 3, 2019
1 parent a176e6d commit bdec361
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions django_minio_backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from time import mktime
from typing import Union
import urllib3

# Django packages
from django.conf import settings
from django.core.files.storage import Storage
Expand Down Expand Up @@ -161,21 +160,21 @@ def url(self, name: str):
raise ConnectionError("Couldn't connect to Minio. Check django_minio_backend parameters in Django-Settings")

def path(self, name):
raise NotImplementedError("Storage system can't be accessed using open().")
raise NotImplementedError("The minIO storage system doesn't support absolute paths.")

def get_accessed_time(self, name: str) -> datetime:
"""
Return the last accessed time (as a datetime) of the file specified by
name. The datetime will be timezone-aware if USE_TZ=True.
"""
return datetime(year=1970, month=1, day=1, hour=0, minute=0, second=0)
raise NotImplementedError('minIO does not store last accessed time')

def get_created_time(self, name: str) -> datetime:
"""
Return the creation time (as a datetime) of the file specified by name.
The datetime will be timezone-aware if USE_TZ=True.
"""
return datetime(year=1970, month=1, day=1, hour=0, minute=0, second=0)
raise NotImplementedError('minIO does not store creation time')

def get_modified_time(self, name: str) -> datetime:
"""
Expand Down

0 comments on commit bdec361

Please sign in to comment.