Pyqt6 bug with QSqlRelationalTableModel and Postgresql (version 13)

Viewed 21

The following code works perfectly with Sqlite3 but not with Postgres. No bug but the returned table is always empty...

self.model = QSqlRelationalTableModel(db=db)        
self.model.setTable("hr_employee")
self.model.setRelation(2, QSqlRelation("Job", "job_id", "name"))
self.model.select()
self.table.setModel(self.model)

if I remove this line, it works !

self.model.setRelation(2, QSqlRelation("Job", "job_id", "name"))

I would appreciate any help because I am stuck.

0 Answers
Related