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

1"""Base class for field widgets.""" 

2 

3import gws 

4 

5 

6class Props(gws.Props): 

7 type: str 

8 readOnly: bool 

9 uid: str 

10 

11 

12class Config(gws.Config): 

13 """Configuration for the widget.""" 

14 

15 readOnly: bool = False 

16 """If True, the value is read-only.""" 

17 

18 

19class Object(gws.ModelWidget): 

20 readOnly: bool 

21 

22 def configure(self): 

23 self.readOnly = self.cfg('readOnly', default=False) 

24 

25 def props(self, user): 

26 return Props(type=self.extType, readOnly=self.readOnly, uid=self.uid)