I have this relational model
rel_model = QSqlRelationalTableModel(self, connectDB)
rel_model.setTable("person")
rel_model.setRelation(1, QSqlRelation("email", "id", "emailAddres"))
rel_model.select()
Main table holds data from the person and the related table several emails from that person. A one to many relationships. How can I update or insert emails now? I know there are insert queries but I guess there must be a way to work directly with the model.
i found a good example in this
https://github.com/ghosert/VimProject/blob/master/pyqt/book_samples/chap15/phonelog-fk.pyw