Coverage for gws-app/gws/plugin/model_widget/feature_list/__init__.py: 96%

23 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-10-16 23:09 +0200

1"""Feature select widget.""" 

2 

3import gws 

4import gws.base.model.widget 

5 

6gws.ext.new.modelWidget('featureList') 

7 

8 

9class Config(gws.base.model.widget.Config): 

10 """Feature list widget configuration.""" 

11 

12 withNewButton: bool = True 

13 """Display the new button.""" 

14 withLinkButton: bool = True 

15 """Display the link button.""" 

16 withEditButton: bool = True 

17 """Display the edit button.""" 

18 withUnlinkButton: bool = False 

19 """Display the unlink button.""" 

20 withDeleteButton: bool = False 

21 """Display the delete button.""" 

22 

23 

24class Props(gws.base.model.widget.Props): 

25 withNewButton: bool 

26 withLinkButton: bool 

27 withEditButton: bool 

28 withUnlinkButton: bool 

29 withDeleteButton: bool 

30 

31 

32class Object(gws.base.model.widget.Object): 

33 def props(self, user): 

34 return gws.u.merge( 

35 super().props(user), 

36 withNewButton=self.cfg('withNewButton', default=True), 

37 withLinkButton=self.cfg('withLinkButton', default=True), 

38 withEditButton=self.cfg('withEditButton', default=True), 

39 withUnlinkButton=self.cfg('withUnlinkButton', default=False), 

40 withDeleteButton=self.cfg('withDeleteButton', default=False), 

41 )