:tocdepth: 3 :py:mod:`gws.plugin.qfield.core` ================================ .. py:module:: gws.plugin.qfield.core .. autoapi-nested-parse:: Qfield reader and writer. **Source code:** :source:`gws.plugin.qfield.core` Module Contents --------------- .. py:class:: EditAction(*args, **kwds) Bases: :py:obj:`gws.Enum` Enumeration type. Despite being declared as extending ``Enum`` (for IDE support), this class is actually just a simple object and intended to be used as a collection of attributes. It doesn't provide any ``Enum``-specific utilities. The rationale behind this is that we need ``Enum`` members (e.g. ``Color.RED``) to be scalars, and not complex objects as in the standard ``Enum``. .. py:attribute:: delete :value: 'delete' .. py:attribute:: geometryUpdate :value: 'geometryUpdate' .. py:attribute:: insert :value: 'insert' .. py:attribute:: update :value: 'update' .. py:class:: EditOperation(*args, **kwargs) Bases: :py:obj:`gws.Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: action :type: EditAction .. py:attribute:: attributes :type: dict .. py:attribute:: columnName :type: str .. py:attribute:: fid :type: int .. py:attribute:: pkey :type: str .. py:class:: ExportArgs(*args, **kwargs) Bases: :py:obj:`gws.Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: baseDir :type: str .. py:attribute:: dbFileName :type: str .. py:attribute:: dbPath :type: str .. py:attribute:: package :type: Package .. py:attribute:: project :type: gws.Project .. py:attribute:: qgisFileName :type: str .. py:attribute:: user :type: gws.User .. py:attribute:: withBaseMap :type: bool .. py:attribute:: withData :type: bool .. py:attribute:: withMedia :type: bool .. py:attribute:: withQgis :type: bool .. py:class:: Exporter .. py:attribute:: args :type: ExportArgs .. py:attribute:: deviceDbPath :type: str .. py:attribute:: localDbPath :type: str .. py:attribute:: package :type: Package .. py:attribute:: project :type: gws.Project .. py:attribute:: qfCaps :type: QFieldCaps .. py:attribute:: sourceQgisProject :type: gws.plugin.qgis.project.Object .. py:attribute:: targetQgisPath :type: str .. py:attribute:: user :type: gws.User .. py:method:: prepare(args: ExportArgs) .. py:method:: replace_vars(s: str) -> str .. py:method:: run(args: ExportArgs) .. py:method:: write_base_map() .. py:method:: write_base_map_layer(le: LayerEntry) .. py:method:: write_data() .. py:method:: write_features(me: ModelEntry, ds: gws.gis.gdalx.VectorDataSet) .. py:method:: write_media() .. py:method:: write_offline_log() .. py:method:: write_qgis_project() .. py:data:: GPKG_EXT :value: 'gpkg' .. py:class:: ImportArgs(*args, **kwargs) Bases: :py:obj:`gws.Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: baseDir :type: str .. py:attribute:: dbFileName :type: str .. py:attribute:: package :type: Package .. py:attribute:: project :type: gws.Project .. py:attribute:: user :type: gws.User .. py:class:: Importer .. py:attribute:: args :type: ImportArgs .. py:attribute:: localDbPath :type: str .. py:attribute:: localImagePaths :type: list[str] .. py:attribute:: package :type: Package .. py:attribute:: project :type: gws.Project .. py:attribute:: qfCaps :type: QFieldCaps .. py:attribute:: updatedModels :type: list[ModelEntry] .. py:attribute:: user :type: gws.User .. py:method:: check_model(me: ModelEntry, user: gws.User, access: gws.Access) -> gws.Model .. py:method:: commit_edits() .. py:method:: commit_edits_for_model(me: ModelEntry) .. py:method:: enumerate_updated_models() .. py:method:: file_value_for_path(path) .. py:method:: prepare(args: ImportArgs) .. py:method:: read_data() .. py:method:: read_edit_operations_for_model(me: ModelEntry, ol: OfflineLog) .. py:method:: read_features() .. py:method:: read_features_for_model(me: ModelEntry, ds: gws.gis.gdalx.VectorDataSet) .. py:method:: read_images() .. py:method:: read_images_for_model(me: ModelEntry) .. py:method:: read_offline_log_for_model(me: ModelEntry, ol: OfflineLog) -> bool .. py:method:: run(args: ImportArgs) .. py:method:: update_file_attributes(eo: EditOperation, file_field_map) .. py:class:: LayerAction(*args, **kwds) Bases: :py:obj:`gws.Enum` Enumeration type. Despite being declared as extending ``Enum`` (for IDE support), this class is actually just a simple object and intended to be used as a collection of attributes. It doesn't provide any ``Enum``-specific utilities. The rationale behind this is that we need ``Enum`` members (e.g. ``Color.RED``) to be scalars, and not complex objects as in the standard ``Enum``. .. py:attribute:: baseMap :value: 'baseMap' .. py:attribute:: edit :value: 'edit' .. py:attribute:: remove :value: 'remove' .. py:class:: LayerEntry(*args, **kwargs) Bases: :py:obj:`gws.Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: action :type: LayerAction .. py:attribute:: dataProvider :type: str .. py:attribute:: dataSource :type: str .. py:attribute:: dataSourceFileName :type: str .. py:attribute:: dataSourcePath :type: str .. py:attribute:: modelEntry :type: ModelEntry .. py:attribute:: qgisId :type: str .. py:attribute:: readOnly :type: bool .. py:attribute:: sourceLayer :type: gws.SourceLayer .. py:attribute:: sqlFilter :type: str .. py:class:: ModelEntry(*args, **kwargs) Bases: :py:obj:`gws.Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: columnIndex :type: dict .. py:attribute:: editOperations :type: list[EditOperation] .. py:attribute:: features :type: list[gws.Feature] .. py:attribute:: fidToPkey :type: dict .. py:attribute:: gpId :type: int .. py:attribute:: gpName :type: str .. py:attribute:: model :type: gws.DatabaseModel .. py:class:: OfflineLog(*args, **kwargs) Bases: :py:obj:`gws.Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: log_added_attrs :type: list[dict] .. py:attribute:: log_added_features :type: list[dict] .. py:attribute:: log_feature_updates :type: list[dict] .. py:attribute:: log_fids :type: list[dict] .. py:attribute:: log_geometry_updates :type: list[dict] .. py:attribute:: log_gws_columns :type: list[dict] .. py:attribute:: log_gws_tables :type: list[dict] .. py:attribute:: log_indices :type: list[dict] .. py:attribute:: log_layer_ids :type: list[dict] .. py:attribute:: log_removed_features :type: list[dict] .. py:class:: Package Bases: :py:obj:`gws.Node` GWS object tree node. .. py:attribute:: mapCacheLifeTime :type: int .. py:attribute:: models :type: list[gws.DatabaseModel] .. py:attribute:: qgisProvider :type: gws.plugin.qgis.provider.Object .. py:method:: configure() Configuration hook. .. py:class:: PackageConfig(*args, **kwargs) Bases: :py:obj:`gws.ConfigWithAccess` Basic config with permissions. .. py:attribute:: mapCacheLifeTime :type: gws.Duration :value: 0 Cache life time for base map layers. .. py:attribute:: models :type: Optional[list[gws.ext.config.model]] Data models. .. py:attribute:: qgisProvider :type: gws.plugin.qgis.provider.Config QGis provider settings. .. py:class:: QFieldCaps(*args, **kwargs) Bases: :py:obj:`gws.Data` Basic data object. This object can be instantiated by passing one or or ``dict`` arguments and/or keyword args. All dicts keys and keywords become attributes of the object. Accessing an undefined attribute returns ``None`` and no error is raised, unless the attribute name starts with an underscore. .. py:attribute:: areaOfInterest :type: Optional[gws.Bounds] .. py:attribute:: baseMapLayerIds :type: list[str] .. py:attribute:: dirsToCopy :type: list[str] .. py:attribute:: globalProps :type: dict .. py:attribute:: layerMap :type: dict[str, LayerEntry] .. py:attribute:: modelMap :type: dict[str, ModelEntry] .. py:attribute:: offlineCopyOnlyAoi :type: bool .. py:attribute:: qgisPath :type: str .. py:class:: QFieldCapsParser Read qf-related capabilities from the qgis project. .. py:attribute:: caps :type: QFieldCaps .. py:attribute:: package :type: Package .. py:attribute:: qgisCaps :type: gws.plugin.qgis.caps.Caps .. py:method:: base_map_layer_ids() -> list[str] .. py:method:: check_dirs_to_copy() .. py:method:: gp_name_for_model(table_name) .. py:method:: layer_entry(sl: gws.SourceLayer) -> Optional[LayerEntry] .. py:method:: model_entry(gp_name: str, model: gws.DatabaseModel) -> ModelEntry .. py:method:: model_entry_for_table(sl: gws.SourceLayer) -> Optional[ModelEntry] .. py:method:: postgres_layer_entry(sl, qf_props) .. py:method:: run(package: Package) -> QFieldCaps .. py:class:: QgisXmlTransformer .. py:attribute:: ex :type: Exporter .. py:attribute:: remove :type: list[gws.XmlElement] .. py:attribute:: root :type: gws.XmlElement .. py:method:: change_global_props() .. py:method:: cleanup_layer_group(group_el) .. py:method:: remove_elements(el, parent_el) .. py:method:: run(ex: Exporter, root_el: gws.XmlElement) .. py:method:: update_edit_widgets() .. py:method:: update_layer_tree() .. py:method:: update_map_layers() .. py:method:: update_referenced_layers()