Sign up ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

We define the python type REGEXP function in sqlite and python following Problem with regexp python and sqlite

How can we do the same thing in PyQT, ie. with a QSqlDatabase?

More precisely, we use the REGEXP function to create a view:

Create view temp as select * from somewhere where columnname REGEXP 'myregex';

This works well, as long as we do the select from python. We would like to show the result in a QTableView (via a QSqlTableModel filled with the view). As the view uses the REGEXP, we would have to link the python regex function to the QSqlDatabase.

share|improve this question
    
Unfamiliar with Qt but this question is unanswered for 2 years so what the heck: Can't QSqlTableModel select from the sqlite view? So QSqlTableModel "thinks" it's consulting a table for QTableView, but it's actually consulting the view which already has the regex in it? (I realize this might be nonsense, please don't sue) – funkwurm Aug 25 '14 at 15:12
    
I'm looking for an answer to this, too. Can anybody help? – Lozzer May 7 at 9:09
    
I'm looking for this answer, too. Strange that nobody seems to be able to do this. Surely it's a common thing to need in a sqlite db. – Lozzer Aug 24 at 1:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.