Skip to content

Commit 1b26324

Browse files
authored
Merge pull request #75 from octue/blob-utils
Move blob utils to correct place
2 parents d8a3dcf + eb180bb commit 1b26324

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

django_gcp/storage/__init__.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# TODO: Refactor tests to import members directly then remove this module export
22
from . import gcloud
3+
from .blob_utils import BlobFieldMixin, get_blob, get_blob_name, get_path, get_signed_url, upload_blob
34
from .gcloud import GoogleCloudFile, GoogleCloudMediaStorage, GoogleCloudStaticStorage, GoogleCloudStorage
45

5-
6-
__all__ = ["GoogleCloudStorage", "GoogleCloudFile", "gcloud", "GoogleCloudMediaStorage", "GoogleCloudStaticStorage"]
6+
__all__ = [
7+
"GoogleCloudStorage",
8+
"GoogleCloudFile",
9+
"gcloud",
10+
"GoogleCloudMediaStorage",
11+
"GoogleCloudStaticStorage",
12+
"BlobFieldMixin",
13+
"get_blob",
14+
"get_blob_name",
15+
"get_path",
16+
"get_signed_url",
17+
"upload_blob",
18+
]

django_gcp/tasks/utils.py django_gcp/storage/blob_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def get_signed_url(instance, field_name, expiration=None):
114114
return get_blob(instance, field_name).generate_signed_url(expiration=expiration)
115115

116116

117-
class BlobFieldModel:
117+
class BlobFieldMixin:
118118
"""Mixin to a model to provide extra utility methods for processing of blobs"""
119119

120120
def get_blob(self, field_name):

django_gcp/tasks/__init__.py

-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
from .manager import TaskManager
22
from .tasks import OnDemandTask, PeriodicTask, SubscriberTask
3-
from .utils import BlobFieldMixin, get_blob, get_blob_name, get_path, get_signed_url, upload_blob
43

54
__all__ = (
65
"PeriodicTask",
76
"SubscriberTask",
87
"OnDemandTask",
98
"TaskManager",
10-
"BlobFieldMixin",
11-
"get_blob",
12-
"get_blob_name",
13-
"get_path",
14-
"get_signed_url",
15-
"upload_blob",
169
)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "django-gcp"
3-
version = "0.14.0"
3+
version = "0.15.0"
44
description = "Utilities to run Django on Google Cloud Platform"
55
authors = ["Tom Clark"]
66
license = "MIT"

0 commit comments

Comments
 (0)