Compare commits
4 commits
108ba6b4ea
...
85f5025efd
| Author | SHA1 | Date | |
|---|---|---|---|
| 85f5025efd | |||
| a83e53afad | |||
| fce7002675 | |||
| 417e28c9c7 |
5 changed files with 20 additions and 5 deletions
|
|
@ -5,6 +5,13 @@ All notable changes to wuttaweb will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## v0.27.5 (2026-02-13)
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- use wutta hint from model if present, for rows title
|
||||||
|
- fix UUID column code generator for new app table wizard
|
||||||
|
|
||||||
## v0.27.4 (2026-02-08)
|
## v0.27.4 (2026-02-08)
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "WuttaWeb"
|
name = "WuttaWeb"
|
||||||
version = "0.27.4"
|
version = "0.27.5"
|
||||||
description = "Web App for Wutta Framework"
|
description = "Web App for Wutta Framework"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = [{name = "Lance Edgar", email = "lance@wuttaproject.org"}]
|
authors = [{name = "Lance Edgar", email = "lance@wuttaproject.org"}]
|
||||||
|
|
|
||||||
|
|
@ -816,9 +816,9 @@
|
||||||
} else if (dataType.type == 'Numeric') {
|
} else if (dataType.type == 'Numeric') {
|
||||||
return `sa.Numeric(precision=${'$'}{dataType.precision}, scale=${'$'}{dataType.scale})`
|
return `sa.Numeric(precision=${'$'}{dataType.precision}, scale=${'$'}{dataType.scale})`
|
||||||
} else if (dataType.type == 'UUID') {
|
} else if (dataType.type == 'UUID') {
|
||||||
return `UUID()`
|
return `model.UUID()`
|
||||||
} else if (dataType.type == '_fk_uuid_') {
|
} else if (dataType.type == '_fk_uuid_') {
|
||||||
return `UUID()`
|
return `model.UUID()`
|
||||||
} else if (dataType.type == '_other_') {
|
} else if (dataType.type == '_other_') {
|
||||||
return dataType.literal
|
return dataType.literal
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -416,8 +416,6 @@ class MasterView(View): # pylint: disable=too-many-public-methods
|
||||||
|
|
||||||
This is optional; see also :meth:`get_row_grid_columns()`.
|
This is optional; see also :meth:`get_row_grid_columns()`.
|
||||||
|
|
||||||
This is optional; see also :meth:`get_row_grid_columns()`.
|
|
||||||
|
|
||||||
.. attribute:: rows_viewable
|
.. attribute:: rows_viewable
|
||||||
|
|
||||||
Boolean indicating whether the row model supports "viewing" -
|
Boolean indicating whether the row model supports "viewing" -
|
||||||
|
|
@ -3795,6 +3793,11 @@ class MasterView(View): # pylint: disable=too-many-public-methods
|
||||||
if hasattr(cls, "row_model_title"):
|
if hasattr(cls, "row_model_title"):
|
||||||
return cls.row_model_title
|
return cls.row_model_title
|
||||||
|
|
||||||
|
if model_class := cls.get_row_model_class():
|
||||||
|
if hasattr(model_class, "__wutta_hint__"):
|
||||||
|
if model_title := model_class.__wutta_hint__.get("model_title"):
|
||||||
|
return model_title
|
||||||
|
|
||||||
return cls.get_row_model_name()
|
return cls.get_row_model_name()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,11 @@ class TestMasterView(WebTestCase):
|
||||||
with patch.object(mod.MasterView, "row_model_class", new=MyModel):
|
with patch.object(mod.MasterView, "row_model_class", new=MyModel):
|
||||||
self.assertEqual(mod.MasterView.get_row_model_title(), "Dinosaur")
|
self.assertEqual(mod.MasterView.get_row_model_title(), "Dinosaur")
|
||||||
|
|
||||||
|
# model class may have wutta hint
|
||||||
|
MyModel.__wutta_hint__ = {"model_title": "T-Rex"}
|
||||||
|
with patch.object(mod.MasterView, "row_model_class", new=MyModel):
|
||||||
|
self.assertEqual(mod.MasterView.get_row_model_title(), "T-Rex")
|
||||||
|
|
||||||
def test_get_row_model_title_plural(self):
|
def test_get_row_model_title_plural(self):
|
||||||
|
|
||||||
# error by default (since no model class)
|
# error by default (since no model class)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue