Hi,
I am working with an existing database (MySQL - Prestashop).
On some tables, auto-incrementation for primary key is not used. And I am
not able to set it, because it goes against the logic of the application. I
know, wired, but...

Is it possible to force SQLObject to insert id manually?

PsMessageReaded(id = myId, idEmployee=3, dateAdd =  tStamp)

When I am trying it, I am getting following error:

    self._executeRetry(conn, c, q)
  File
"/usr/lib/python2.5/site-packages/SQLObject-0.10.1-py2.5.egg/sqlobject/mysql/mysqlconnection.py",
line 129, in _executeRetry
    raise ProgrammingError(ErrorMessage(e))
sqlobject.dberrors.ProgrammingError: Column 'id_message' specified twice



id_message is the name of the primary key column in the table:

class PsMessageReaded(SQLObject):
    _connection = connection
    class sqlmeta:
        idName = 'id_message'
        fromDatabase = True

Thanks for your comments

Petr Jakes
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to