PyQt5: specifying QSqlTableModel

Colin McPhail colin.mcphail at mac.com
Thu Jun 3 21:05:13 BST 2021


Rich,

> On 3 Jun 2021, at 18:26, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> 
> On Thu, 3 Jun 2021, Maurizio Berti wrote:
> 
>> The database_setup.py is incomplete, so it's a bit difficult to be sure
>> here, but, going on a hunch and given the error, "dbs" is the class, while
>> db is an *instance* attribute.
> 
> Maurizio,
> 
> Yes, I find myself wrapped around the axle here as it's all new to me.
> 
> Taking your advice I've modified both datasource.py and activitytypes.py and
> I'm back to having a blank window opened but not having the pdb prompt
> returned:
> ...
> The revised files are attached.
> 
> Thanks,
> 
> Rich

I made a few changes to your files to see what was needed to make a SQL table appear. I used a SqlLite3 database since that was what I had available. I have attached updated versions of your files.

Hope this helps,
Colin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: activitytypes.py
Type: text/x-python-script
Size: 1242 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210603/e9475da9/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: datasource.py
Type: text/x-python-script
Size: 1133 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210603/e9475da9/attachment-0003.bin>


More information about the PyQt mailing list