[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: PyQt5: specifying QSqlTableModel
From:       Rich Shepard <rshepard () appl-ecosys ! com>
Date:       2021-06-05 18:49:31
Message-ID: alpine.LNX.2.20.2106051140350.25613 () salmo ! appl-ecosys ! com
[Download RAW message or body]

On Sat, 5 Jun 2021, Colin McPhail wrote:

> However, I do notice that the list of tables in your database has a column
> called 'Owner.' Do you think that in datasource.py you should use the
> version of open() that takes a username and password? If that's not
> relevant you could maybe ask for ideas on StackOverflow if you haven't
> already.

Colin,

To follow up on this idea.

1. Using only self.db.open() an empty window displays and the application
halts.

2. Adding (after setting the db name),
self.db.setHostName('aaa')
self.db.setUserName('bbb')
self.db.setPassword('ccc')
(with actual values throws this error):
Traceback (most recent call last):
   File "activitytypes.py", line 7, in <module>
     from PyQt5 import QtWidgets as qtw
   File "activitytypes.py", line 27, in __init__
     act_tbl = DBSetup()
   File "/home/rshepard/development/business_tracker/datasource.py", line 20, in __init__
     if not self.db.open():
NameError: name 'db' is not defined

Huh!

This 11 May, 2020 update to
<https://www.geeksforgeeks.org/pyqt5-qtsql-python/> uses mysql in its
example, but there is no open() for the database. After connecting it
defines a query.

I'm going to try this.

Rich
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic