Re: Please Explain This Error
Liam Clarke <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
Please forward a copy of policyPage.py.
Rich Shepard wrote:
> In my wxPython application, each notebook page is a separate module file.
> I insert, update, and select records from the sqlite3 database in each of
> these modules. Until now, python has not complained about opening the
> application. But, in the module with the class 'modPolicy' I get this error:
>
> File "/data1/eikos/policyPage.py", line 60, in __init__
> self.cur.execute("select * from component where category = 'natural';")
> AttributeError: 'modPolicy' object has no attribute 'cur'
>
> The offending line is in the __init__ method:
>
> natComp = []
> self.cur.execute("select * from component where category=natural;")
> row = cur.fetchone()
> while row:
> natComp = row[2]
> # get next row
> row = cur.fetchone()
> for x in natComp:
> polID = self.polTree.AppendItem(self.natID, 'x')
>
> Every reference to the open database cursor in the other modules is
> written the same way, so I don't see what is broken in the above syntax.
>
> Clues greatly appreciated.
>
> Rich
>
>