Re: Cursor Not Passed Properly Inter-Module

Rich Shepard <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
On Tue, 28 Nov 2006, William J Chapman wrote:

> You seen to be wanting to call methods on class DBtools without first
> creating an instance.  You appear to call the DBtools constructor (i.e.,
> DBtools().CreateDB(...)) in OnNewMod() but don't save a reference. Then in
> OnSaveMod() you invoke DBtools.cur.exectue(...), but you don't appear to
> specify the instance of DBtools to use.

Bill,

   Thanks. I tried creating instances, but that did not solve the problem.
There's no problem calling methods in DBtools(), but there was in trying to
access the cursor.

   I solved that by putting a copy of the connection and cursor in the
generic configData() class that's imported by all other modules.

   Perhaps you have some insight into why the data seem to be written to the
table via the open cursor, but they're not there. No error messages offered
by python or pysqlite. I just posted that to the list.

   One of these days I'll get past the learning curve and be more productive
and less questioning.

Rich

-- 
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)    |            Accelerator
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.