QSqlRelation¶
The
QSqlRelation
class stores information about an SQL foreign key. More…
Synopsis¶
Functions¶
def
displayColumn
()def
indexColumn
()def
isValid
()def
swap
(other)def
tableName
()
Detailed Description¶
QSqlRelation
is a helper class forQSqlRelationalTableModel
. SeesetRelation()
andrelation()
for details.See also
QSqlRelationalTableModel
QSqlRelationalDelegate
Relational Table Model Example
- class PySide2.QtSql.QSqlRelation¶
PySide2.QtSql.QSqlRelation(QSqlRelation)
PySide2.QtSql.QSqlRelation(aTableName, indexCol, displayCol)
- param QSqlRelation:
- param aTableName:
str
- param indexCol:
str
- param displayCol:
str
Constructs an invalid
QSqlRelation
object.For such an object, the
tableName()
,indexColumn()
, anddisplayColumn()
functions return an empty string.See also
Constructs a
QSqlRelation
object, wheretableName
is the SQL table name to which a foreign key refers,indexColumn
is the foreign key, anddisplayColumn
is the field that should be presented to the user.See also
- PySide2.QtSql.QSqlRelation.displayColumn()¶
- Return type:
str
Returns the column from table
tableName()
that should be presented to the user instead of a foreign key.
- PySide2.QtSql.QSqlRelation.indexColumn()¶
- Return type:
str
Returns the index column from table
tableName()
to which a foreign key refers.
- PySide2.QtSql.QSqlRelation.isValid()¶
- Return type:
bool
Returns
true
if theQSqlRelation
object is valid; otherwise returnsfalse
.
- PySide2.QtSql.QSqlRelation.swap(other)¶
- Parameters:
other –
PySide2.QtSql.QSqlRelation
Swaps
this
withother
.
- PySide2.QtSql.QSqlRelation.tableName()¶
- Return type:
str
Returns the name of the table to which a foreign key refers.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.