aboutsummaryrefslogtreecommitdiffstats
path: root/examples/sql/books
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sql/books')
-rw-r--r--examples/sql/books/createdb.py12
-rw-r--r--examples/sql/books/main.py2
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/sql/books/createdb.py b/examples/sql/books/createdb.py
index d1f624ae0..48784a88e 100644
--- a/examples/sql/books/createdb.py
+++ b/examples/sql/books/createdb.py
@@ -48,19 +48,19 @@ def add_book(q, title, year, authorId, genreId, rating):
q.addBindValue(authorId)
q.addBindValue(genreId)
q.addBindValue(rating)
- q.exec_()
+ q.exec()
def add_genre(q, name):
q.addBindValue(name)
- q.exec_()
+ q.exec()
return q.lastInsertId()
def add_author(q, name, birthdate):
q.addBindValue(name)
q.addBindValue(str(birthdate))
- q.exec_()
+ q.exec()
return q.lastInsertId()
@@ -103,9 +103,9 @@ def init_db():
check(db.open)
q = QSqlQuery()
- check(q.exec_, BOOKS_SQL)
- check(q.exec_, AUTHORS_SQL)
- check(q.exec_, GENRES_SQL)
+ check(q.exec, BOOKS_SQL)
+ check(q.exec, AUTHORS_SQL)
+ check(q.exec, GENRES_SQL)
check(q.prepare, INSERT_AUTHOR_SQL)
asimovId = add_author(q, "Isaac Asimov", date(1920, 2, 1))
diff --git a/examples/sql/books/main.py b/examples/sql/books/main.py
index e957869ac..3994a66b4 100644
--- a/examples/sql/books/main.py
+++ b/examples/sql/books/main.py
@@ -50,4 +50,4 @@ if __name__ == "__main__":
window.resize(800, 600)
window.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())