Skip to content

Commit 68be5b3

Browse files
committed
ENH: Add get_bucket to BlobFieldMixin
1 parent ad9549a commit 68be5b3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
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"

0 commit comments

Comments
 (0)