Coverage for gws-app/gws/plugin/qfieldcloud/core.py: 100%

22 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-24 12:46 +0200

1from typing import Optional 

2import gws 

3import gws.plugin.qgis.provider 

4 

5 

6class ProjectConfig(gws.ConfigWithAccess): 

7 """QField Cloud project.""" 

8 

9 title: str = '' 

10 """Project title.""" 

11 provider: gws.plugin.qgis.provider.Config 

12 """QGis provider settings.""" 

13 models: Optional[list[gws.ext.config.model]] 

14 """Data models.""" 

15 mapCacheLifeTime: gws.Duration = '0' 

16 """Cache life time for base map layers.""" 

17 

18 

19class QfcProject(gws.Node): 

20 title: str 

21 qgisProvider: gws.plugin.qgis.provider.Object 

22 models: list[gws.DatabaseModel] 

23 mapCacheLifeTime: int 

24 

25 def configure(self): 

26 self.title = self.cfg('title', '') or self.uid 

27 self.qgisProvider = self.create_child(gws.plugin.qgis.provider.Object, self.cfg('provider')) 

28 self.models = self.create_children(gws.ext.object.model, self.cfg('models')) 

29 self.mapCacheLifeTime = self.cfg('mapCacheLifeTime') or 0 

30 

31