def add_user(session, tmp_name):
    session.add(User(name=tmp_name))
session.commit()
if not session.query(User).count():
    session.add(User(name='edouard'))
session.add(User(name='jean'))
session.add(User(name='albert'))
session.commit()
app = QtGui.QApplication(sys.argv)
mywindow = QtGui.QWidget()
combobox = QtGui.QComboBox(mywindow)
combobox.setModel(UserListModel(session))
mywindow.show()
sys.exit(app.exec_())
PyQt application with sqlalchemy database