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
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
-
extractJoinedFeature
(self, feature: QgsFeature) → QgsFeature¶ Extract the join feature from the target feature for the current join layer information.
- Parameters
feature (QgsFeature) – A feature from the target layer
- Return type
- 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.
- Return type
bool
-
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.
- Parameters
blacklisted (bool = True) –
- Return type
bool
-
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.
- Return type
bool
-
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.
- Return type
bool
-
isEditable
(self) → bool¶ Returns whether joined fields may be edited through the form of the target layer.
New in version 3.0.
- Return type
bool
-
isUsingMemoryCache
(self) → bool¶ Returns whether values from the joined layer should be cached in memory to speed up lookups
- Return type
bool
-
joinFieldName
(self) → str¶ Returns name of the field of joined layer that will be used for join
- Return type
str
-
joinFieldNamesBlackList
(self) → List[str]¶ Returns the list of fields to ignore.
New in version 3.0.
- Return type
List[str]
-
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.
- Parameters
info (QgsVectorLayerJoinInfo) –
blacklisted (bool = True) –
- Return type
List[str]
-
joinLayer
(self) → QgsVectorLayer¶ Returns joined layer (may be null if the reference was set by layer ID and not resolved yet)
- Return type
-
joinLayerId
(self) → str¶ ID of the joined layer - may be used to resolve reference to the joined layer
- Return type
str
-
prefix
(self) → str¶ Returns prefix of fields from the joined layer. If null, joined layer’s name will be used.
- Return type
str
-
prefixedFieldName
(self, field: QgsField) → str¶ Returns the prefixed name of the field.
- Parameters
field (QgsField) – the field
- Return type
str
- 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.
- Parameters
enabled (bool) –
-
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.
- Parameters
enabled (bool) –
-
setEditable
(self, enabled: bool)¶ Sets whether the form of the target layer allows editing joined fields.
New in version 3.0.
- Parameters
enabled (bool) –
-
setJoinFieldName
(self, fieldName: str)¶ Sets name of the field of joined layer that will be used for join
- Parameters
fieldName (str) –
-
setJoinFieldNamesBlackList
(self, blackList: Iterable[str])¶ Sets a list of fields to ignore whatever happens.
New in version 3.0.
- Parameters
blackList (Iterable[str]) –
-
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.
- Parameters
fieldNamesSubset (Iterable[str]) –
-
setJoinLayer
(self, layer: QgsVectorLayer)¶ Sets weak reference to the joined layer
- Parameters
layer (QgsVectorLayer) –
-
setJoinLayerId
(self, layerId: str)¶ Sets ID of the joined layer. It will need to be overwritten by setJoinLayer() to a reference to real layer
- Parameters
layerId (str) –
-
setPrefix
(self, prefix: str)¶ Sets prefix of fields from the joined layer. If null, joined layer’s name will be used.
- Parameters
prefix (str) –
-
setTargetFieldName
(self, fieldName: str)¶ Sets name of the field of our layer that will be used for join
- Parameters
fieldName (str) –
-
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.
- Parameters
enabled (bool) –
-
setUsingMemoryCache
(self, enabled: bool)¶ Sets whether values from the joined layer should be cached in memory to speed up lookups
- Parameters
enabled (bool) –
-
targetFieldName
(self) → str¶ Returns name of the field of our layer that will be used for join
- Return type
str
-