Coverage for gws-app / gws / plugin / model_value / format / __init__.py: 0%
12 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-03 10:12 +0100
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-03 10:12 +0100
1"""Format value.
3This value is computed by applying python `format` to feature attributes.
4"""
6import gws
7import gws.base.model.value
9gws.ext.new.modelValue('format')
12class Config(gws.base.model.value.Config):
13 """Format value configuration."""
15 format: str
16 """Format string to apply to feature attributes."""
19class Object(gws.base.model.value.Object):
20 format: str
22 def configure(self):
23 self.format = self.cfg('format')
25 def compute(self, field, feature, mc):
26 return gws.u.format_map(self.format, feature.attributes)