Coverage for gws-app/gws/base/model/widget.py: 100%
14 statements
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-16 22:59 +0200
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-16 22:59 +0200
1"""Base class for field widgets."""
3import gws
6class Props(gws.Props):
7 type: str
8 readOnly: bool
9 uid: str
12class Config(gws.Config):
13 """Configuration for the widget."""
15 readOnly: bool = False
16 """If True, the value is read-only."""
19class Object(gws.ModelWidget):
20 readOnly: bool
22 def configure(self):
23 self.readOnly = self.cfg('readOnly', default=False)
25 def props(self, user):
26 return Props(type=self.extType, readOnly=self.readOnly, uid=self.uid)