fix: use wutta hint from model, for master view title
This commit is contained in:
parent
a17d7da74c
commit
cbfa7f652f
1 changed files with 13 additions and 1 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# wuttaweb -- Web App for Wutta Framework
|
# wuttaweb -- Web App for Wutta Framework
|
||||||
# Copyright © 2024-2025 Lance Edgar
|
# Copyright © 2024-2026 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Wutta Framework.
|
# This file is part of Wutta Framework.
|
||||||
#
|
#
|
||||||
|
|
@ -3514,6 +3514,11 @@ class MasterView(View): # pylint: disable=too-many-public-methods
|
||||||
if hasattr(cls, "model_title"):
|
if hasattr(cls, "model_title"):
|
||||||
return cls.model_title
|
return cls.model_title
|
||||||
|
|
||||||
|
if model_class := cls.get_model_class():
|
||||||
|
if hasattr(model_class, "__wutta_hint__"):
|
||||||
|
if model_title := model_class.__wutta_hint__.get("model_title"):
|
||||||
|
return model_title
|
||||||
|
|
||||||
return cls.get_model_name()
|
return cls.get_model_name()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
@ -3532,6 +3537,13 @@ class MasterView(View): # pylint: disable=too-many-public-methods
|
||||||
if hasattr(cls, "model_title_plural"):
|
if hasattr(cls, "model_title_plural"):
|
||||||
return cls.model_title_plural
|
return cls.model_title_plural
|
||||||
|
|
||||||
|
if model_class := cls.get_model_class():
|
||||||
|
if hasattr(model_class, "__wutta_hint__"):
|
||||||
|
if model_title_plural := model_class.__wutta_hint__.get(
|
||||||
|
"model_title_plural"
|
||||||
|
):
|
||||||
|
return model_title_plural
|
||||||
|
|
||||||
model_title = cls.get_model_title()
|
model_title = cls.get_model_title()
|
||||||
return f"{model_title}s"
|
return f"{model_title}s"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue