Class: QgsVectorLayerJoinInfo¶
-
class
qgis.core.
QgsVectorLayerJoinInfo
¶ Bases:
sip.wrapper
Constructor for QgsVectorLayerJoinInfo.
QgsVectorLayerJoinInfo(QgsVectorLayerJoinInfo)
Defines left outer join from our vector layer to some other vector layer. The join is done based on [our layer].targetField = [join layer].joinField
New in version 3.0: Enums
Methods
Extract the join feature from the target feature for the current join layer information.
Returns whether a feature deleted on the target layer has to impact the joined layer by deleting the corresponding joined feature.
Returns true if blacklisted fields is not empty or if a subset of names has been set.
Returns whether a feature created on the target layer has to impact the joined layer by creating a new feature if necessary.
Returns whether the form has to be dynamically updated with joined fields when a feature is being created in the target layer.
Returns whether joined fields may be edited through the form of the target layer.
Returns whether values from the joined layer should be cached in memory to speed up lookups
Returns name of the field of joined layer that will be used for join
Returns the list of fields to ignore.
Returns the list of field names to use for joining considering blacklisted fields and subset.
Returns joined layer (may be null if the reference was set by layer ID and not resolved yet)
ID of the joined layer - may be used to resolve reference to the joined layer
Returns prefix of fields from the joined layer.
Returns the prefixed name of the field.
Sets whether a feature deleted on the target layer has to impact the joined layer by deleting the corresponding joined feature.
Sets whether the form has to be dynamically updated with joined fields when a feature is being created in the target layer.
Sets whether the form of the target layer allows editing joined fields.
Sets name of the field of joined layer that will be used for join
Sets a list of fields to ignore whatever happens.
Set subset of fields to be used from joined layer.
Sets weak reference to the joined layer
Sets ID of the joined layer.
Sets prefix of fields from the joined layer.
Sets name of the field of our layer that will be used for join
Sets whether a feature created on the target layer has to impact the joined layer by creating a new feature if necessary.
Sets whether values from the joined layer should be cached in memory to speed up lookups
Returns name of the field of our layer that will be used for join
Signals
Attributes
-
extractJoinedFeature
(self, feature: QgsFeature) → QgsFeature¶ Extract the join feature from the target feature for the current join layer information.
- Parameters
feature – A feature from the target layer
- Returns
the corresponding joined feature
New in version 3.0.
-
hasCascadedDelete
(self) → bool¶ Returns whether a feature deleted on the target layer has to impact the joined layer by deleting the corresponding joined feature.
New in version 3.0.
-
hasSubset
(self, blacklisted: bool = True) → bool¶ Returns true if blacklisted fields is not empty or if a subset of names has been set.
New in version 3.0.
-
hasUpsertOnEdit
(self) → bool¶ Returns whether a feature created on the target layer has to impact the joined layer by creating a new feature if necessary.
New in version 3.0.
-
isDynamicFormEnabled
(self) → bool¶ Returns whether the form has to be dynamically updated with joined fields when a feature is being created in the target layer.
New in version 3.0.
-
isEditable
(self) → bool¶ Returns whether joined fields may be edited through the form of the target layer.
New in version 3.0.
-
isUsingMemoryCache
(self) → bool¶ Returns whether values from the joined layer should be cached in memory to speed up lookups
-
joinFieldName
(self) → str¶ Returns name of the field of joined layer that will be used for join
-
joinFieldNamesBlackList
(self) → List[str]¶ Returns the list of fields to ignore.
New in version 3.0.
-
joinFieldNamesSubset
(info: QgsVectorLayerJoinInfo, blacklisted: bool = True) → List[str]¶ Returns the list of field names to use for joining considering blacklisted fields and subset.
New in version 3.0.
joinFieldNamesSubset(self) -> List[str] Gets subset of fields to be used from joined layer. All fields will be used if null is returned.
New in version 2.6.
-
joinLayer
(self) → QgsVectorLayer¶ Returns joined layer (may be null if the reference was set by layer ID and not resolved yet)
-
joinLayerId
(self) → str¶ ID of the joined layer - may be used to resolve reference to the joined layer
-
prefix
(self) → str¶ Returns prefix of fields from the joined layer. If null, joined layer’s name will be used.
-
prefixedFieldName
(self, field: QgsField) → str¶ Returns the prefixed name of the field.
- Parameters
field – the field
- Returns
the prefixed name of the field
New in version 3.0.
-
setCascadedDelete
(self, enabled: bool)¶ Sets whether a feature deleted on the target layer has to impact the joined layer by deleting the corresponding joined feature.
New in version 3.0.
-
setDynamicFormEnabled
(self, enabled: bool)¶ Sets whether the form has to be dynamically updated with joined fields when a feature is being created in the target layer.
New in version 3.0.
-
setEditable
(self, enabled: bool)¶ Sets whether the form of the target layer allows editing joined fields.
New in version 3.0.
-
setJoinFieldName
(self, fieldName: str)¶ Sets name of the field of joined layer that will be used for join
-
setJoinFieldNamesBlackList
(self, blackList: Iterable[str])¶ Sets a list of fields to ignore whatever happens.
New in version 3.0.
-
setJoinFieldNamesSubset
(self, fieldNamesSubset: Iterable[str])¶ Set subset of fields to be used from joined layer. Takes ownership of the passed pointer. Null pointer tells to use all fields.
New in version 2.6.
-
setJoinLayer
(self, layer: QgsVectorLayer)¶ Sets weak reference to the joined layer
-
setJoinLayerId
(self, layerId: str)¶ Sets ID of the joined layer. It will need to be overwritten by setJoinLayer() to a reference to real layer
-
setPrefix
(self, prefix: str)¶ Sets prefix of fields from the joined layer. If null, joined layer’s name will be used.
-
setTargetFieldName
(self, fieldName: str)¶ Sets name of the field of our layer that will be used for join
-
setUpsertOnEdit
(self, enabled: bool)¶ Sets whether a feature created on the target layer has to impact the joined layer by creating a new feature if necessary.
New in version 3.0.
-
setUsingMemoryCache
(self, enabled: bool)¶ Sets whether values from the joined layer should be cached in memory to speed up lookups
-
targetFieldName
(self) → str¶ Returns name of the field of our layer that will be used for join
-