Skip to content

Commit f175b94

Browse files
authored
Merge pull request #88 from octue/get-bucket-name
Add a `get_bucket_name` method to blob field utils
2 parents 88b9249 + e8741cb commit f175b94

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
@@ -92,6 +92,10 @@ def get_blob_name(self, field_name):
9292
def get_bucket(cls, field_name):
9393
return cls._meta.get_field(field_name).storage.bucket
9494

95+
@classmethod
96+
def get_bucket_name(cls, field_name):
97+
return cls.get_bucket(field_name).name
98+
9599
def get_console_url(self, field_name):
96100
"""Get a URL to where the file resides in GCP cloud console"""
97101
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.2"
3+
version = "0.18.3"
44
description = "Utilities to run Django on Google Cloud Platform"
55
authors = ["Tom Clark"]
66
license = "MIT"

0 commit comments

Comments
 (0)