[PyKDE] problem overloading QSqlCursor.update()

Hans-Peter Jansen hpj at urpla.net
Tue Jul 2 22:20:00 BST 2002


Hi Phil,

I need to overload QSqlCursor.update() in order to fix some values
before throwing them into the database, namely a TIMESTAMP value,
which must be NULL in order to work correctly database wise, and
a changedby field, both aren't presented to the user.

class ArtikelEditCursor(QSqlCursor):
    def __init__(self, *args):
        apply(QSqlCursor.__init__, (self,) + args)

    def update(self, inv = TRUE):
        rec = self.editBuffer()
        rec.setValue("changed", QVariant(0))
        rec.setValue("changedby", QVariant(config.user))
        return QSqlCursor.update(self, inv)

But no matter, what arguments I supply to the QSqlCursor.update()
call, (with or without inv), I see strange messages like:

TypeError: update() takes at most 2 arguments (3 given)
TypeError: update() takes exactly 2 arguments (3 given)

Any ideas?

Hans-Peter




More information about the PyQt mailing list