Skip to content

Commit 22002f3

Browse files
Type name override
Improve the name of the method that allows us to override the type name. Offically we would like to call ModelInfo - Model, but Model already exists and I don't want Model to also become a type delta. Model is both a entity for state and an entity for connections and to become an entity for deltas seems like a bit too much.
1 parent e25fc9b commit 22002f3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

juju/model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ def entity_type(self):
304304
# Allow the overriding of entity names from the type instead of from
305305
# the class name. Useful because Model and ModelInfo clash and we really
306306
# want ModelInfo to be called Model.
307-
if hasattr(self.__class__, "entity_name") and callable(self.__class__.entity_name):
308-
return self.__class__.entity_name()
307+
if hasattr(self.__class__, "type_name_override") and callable(self.__class__.type_name_override):
308+
return self.__class__.type_name_override()
309309

310310
def first_lower(s):
311311
if len(s) == 0:
@@ -2300,5 +2300,5 @@ def tag(self):
23002300
return tag.model(self.uuid)
23012301

23022302
@staticmethod
2303-
def entity_name():
2303+
def type_name_override():
23042304
return "model"

0 commit comments

Comments
 (0)