Subgroup: Vector

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: Methods

extractJoinedFeature Extract the join feature from the target feature for the current join layer information.
hasCascadedDelete Returns whether a feature deleted on the target layer has to impact the joined layer by deleting the corresponding joined feature.
hasSubset Returns true if blacklisted fields is not empty or if a subset of names has been set.
hasUpsertOnEdit Returns whether a feature created on the target layer has to impact the joined layer by creating a new feature if necessary.
isDynamicFormEnabled Returns whether the form has to be dynamically updated with joined fields when a feature is being created in the target layer.
isEditable Returns whether joined fields may be edited through the form of the target layer.
isUsingMemoryCache Returns whether values from the joined layer should be cached in memory to speed up lookups
joinFieldName Returns name of the field of joined layer that will be used for join
joinFieldNamesBlackList Returns the list of fields to ignore.
joinFieldNamesSubset Returns the list of field names to use for joining considering blacklisted fields and subset.
joinLayer Returns joined layer (may be null if the reference was set by layer ID and not resolved yet)
joinLayerId ID of the joined layer - may be used to resolve reference to the joined layer
prefix Returns prefix of fields from the joined layer.
prefixedFieldName Returns the prefixed name of the field.
setCascadedDelete Sets whether a feature deleted on the target layer has to impact the joined layer by deleting the corresponding joined feature.
setDynamicFormEnabled Sets whether the form has to be dynamically updated with joined fields when a feature is being created in the target layer.
setEditable Sets whether the form of the target layer allows editing joined fields.
setJoinFieldName Sets name of the field of joined layer that will be used for join
setJoinFieldNamesBlackList Sets a list of fields to ignore whatever happens.
setJoinFieldNamesSubset Set subset of fields to be used from joined layer.
setJoinLayer Sets weak reference to the joined layer
setJoinLayerId Sets ID of the joined layer.
setPrefix Sets prefix of fields from the joined layer.
setTargetFieldName Sets name of the field of our layer that will be used for join
setUpsertOnEdit Sets whether a feature created on the target layer has to impact the joined layer by creating a new feature if necessary.
setUsingMemoryCache Sets whether values from the joined layer should be cached in memory to speed up lookups
targetFieldName 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] Get 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