Actually I think it was a change in the MySQLdb API. I believe that
insert_id() moved from the cursor object to the connection object in the
latest versions.
I've fixed it either by installing an older version of MySQLdb or by
editing MySQLObjectStore.py to:
def retrieveLastInsertId(self, conn, cur):
conn, cur = self.executeSQL('select last_insert_id();', conn)
return cur.fetchone()[0]
-Seth
On Tue, 2005-01-25 at 02:51 -0600, jacob martinson wrote:
> Hi,
>
> I was just trying out middlekit for the first time and ran into a
> problem. I was following the quick start guide and when I tried
> running the code with "store.saveChanges()" in main, I get this error:
>
> $ ./main.py
> Traceback (most recent call last):
> File "./main.py", line 31, in ?
> main()
> File "./main.py", line 27, in main
> store.saveChanges()
> File "MiddleKit/Run/ObjectStore.py", line 316, in saveChanges
> File "MiddleKit/Run/SQLObjectStore.py", line 193, in commitInserts
> File "MiddleKit/Run/SQLObjectStore.py", line 214, in _insertObject
> File "MiddleKit/Run/MySQLObjectStore.py", line 36, in retrieveLastInsertId
> AttributeError: 'Cursor' object has no attribute 'insert_id'
>
> I would guess it was related to the wrong version of Mysql, but I
> didn't see anything in the webware docs about which versions are
> supported.
>
> System details:
> debian/sarge
>
> python2.3 2.3.4-18
> python2.3-mysqldb 1.1.6-1
> mysql-client 4.0.23-1
> mysql-server 4.0.23-1
> webware 0.8.1
>
> Has anyone ever seen this before?
>
> Thanks!
>
> -Jacob
>
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Webware-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/webware-discuss