Skip to content

Commit 88b9249

Browse files
authored
Merge pull request #87 from octue/blobfield-mixin
Add get_bucket classmethod to BlobFieldMixin
2 parents fd59b2b + 68be5b3 commit 88b9249

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

django_gcp/storage/blob_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ def get_blob_name(self, field_name):
8888
"""Get blob name for the given model field name"""
8989
return get_blob_name(self, field_name)
9090

91+
@classmethod
92+
def get_bucket(cls, field_name):
93+
return cls._meta.get_field(field_name).storage.bucket
94+
9195
def get_console_url(self, field_name):
9296
"""Get a URL to where the file resides in GCP cloud console"""
9397
return get_console_url(self, field_name)

pyproject.toml

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

tests/server/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def get_db_conf():
161161
# LIMIT SIZE OF BLOBFIELD UPLOADS
162162
# This can be customized per BlobField. Default if not given is unlimited upload
163163
# size, which is unwise if your users are not both trusted and competent
164-
GCP_STORAGE_BLOBFIELD_MAX_SIZE_BYTES = 32 * 1024 * 1024
164+
GCP_STORAGE_BLOBFIELD_MAX_SIZE_BYTES = 0 # 32 * 1024 * 1024
165165

166166
# MEDIA FILES
167167
DEFAULT_FILE_STORAGE = "django_gcp.storage.GoogleCloudMediaStorage"

0 commit comments

Comments
 (0)