Class: QgsAttributeEditorRelation¶
This element will load a relation editor onto the form.
Class Hierarchy¶
Base classes¶
This is an abstract base class for any elements of a drag and drop form.  | 
Methods
Determines the force suppress form popup status.  | 
|
Initializes the relation from the id  | 
|
Determines the label of this element  | 
|
Determines the relation id of the second relation involved in an N:M relation.  | 
|
Gets the id of the relation which shall be embedded  | 
|
Returns the relation editor widget configuration  | 
|
Returns the current relation widget type id  | 
|
Sets force suppress form popup status to forceSuppressFormPopup.  | 
|
Sets label for this element If it's empty it takes the relation id as label  | 
|
Sets nmRelationId for the relation id of the second relation involved in an N:M relation.  | 
|
Sets the relation editor configuration  | 
|
Sets the relation widget type  | 
Attributes
- class qgis.core.QgsAttributeEditorRelation[source]¶
 Bases:
QgsAttributeEditorElement- __init__(name: str | None, relationId: str | None, parent: QgsAttributeEditorElement | None)
 Deprecated since version 3.16.
- Parameters:
 name (Optional[str])
relationId (Optional[str])
parent (Optional[QgsAttributeEditorElement])
- __init__(name: str | None, relation: QgsRelation, parent: QgsAttributeEditorElement | None)
 Deprecated since version 3.16.
- Parameters:
 name (Optional[str])
relation (QgsRelation)
parent (Optional[QgsAttributeEditorElement])
- __init__(relationId: str | None, parent: QgsAttributeEditorElement | None)
 Creates a new element which embeds a relation.
- Parameters:
 relationId (Optional[str]) – The id of the relation to embed
parent (Optional[QgsAttributeEditorElement]) – The parent (used as container)
- __init__(relation: QgsRelation, parent: QgsAttributeEditorElement | None)
 Creates a new element which embeds a relation.
- Parameters:
 relation (QgsRelation) – The relation to embed
parent (Optional[QgsAttributeEditorElement]) – The parent (used as container)
- __init__(a0: QgsAttributeEditorRelation)
 - Parameters:
 
- AddChildFeature = 16¶
 
- AllButtons = 254¶
 
- class Button¶
 Bases:
int
- class Buttons¶
 - class Buttons(f: QgsAttributeEditorRelation.Buttons | QgsAttributeEditorRelation.Button)
 - class Buttons(a0: QgsAttributeEditorRelation.Buttons)
 Bases:
object
- DeleteChildFeature = 64¶
 
- DuplicateChildFeature = 32¶
 
- Link = 2¶
 
- SaveChildEdits = 8¶
 
- Unlink = 4¶
 
- ZoomToChildFeature = 128¶
 
- forceSuppressFormPopup(self) bool[source]¶
 Determines the force suppress form popup status.
Added in version 3.16.
- Return type:
 bool
- init(self, relManager: QgsRelationManager | None) bool[source]¶
 Initializes the relation from the id
- Parameters:
 relManager (Optional[QgsRelationManager]) – The relation manager to use for the initialization
- Return type:
 bool
- Returns:
 Trueif the relation was found in the relationmanager
- label(self) str[source]¶
 Determines the label of this element
Added in version 3.16.
- Return type:
 str
- nmRelationId(self) Any[source]¶
 Determines the relation id of the second relation involved in an N:M relation.
Added in version 3.16.
- Return type:
 Any
- relation(self) QgsRelation¶
 Gets the id of the relation which shall be embedded
- Return type:
 - Returns:
 the id
- relationEditorConfiguration(self) Dict[str, Any][source]¶
 Returns the relation editor widget configuration
Added in version 3.18.
- Return type:
 Dict[str, Any]
- relationWidgetTypeId(self) str[source]¶
 Returns the current relation widget type id
Added in version 3.18.
- Return type:
 str
- setForceSuppressFormPopup(self, forceSuppressFormPopup: bool)[source]¶
 Sets force suppress form popup status to
forceSuppressFormPopup. This flag is to override the layer and general settings regarding the automatic opening of the attribute form dialog when digitizing is completed.Added in version 3.16.
- Parameters:
 forceSuppressFormPopup (bool)
- setLabel(self, label: str | None = '')[source]¶
 Sets
labelfor this element If it’s empty it takes the relation id as labelAdded in version 3.16.
- Parameters:
 label (Optional[str] = '')
- setNmRelationId(self, nmRelationId: Any = None)[source]¶
 Sets
nmRelationIdfor the relation id of the second relation involved in an N:M relation. If it’s empty, then it’s considered as a 1:M relationship.Added in version 3.16.
- Parameters:
 nmRelationId (Any = None)