Re: [gnome-db] update_row not implemented in GdaDataModelHash



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vivien Malerba wrote:
> However I doubt it will be very usefull: the data returned from a
> SELECT command can now be edited (in most if not all the cases since
> the provider's own implementations of the returned data model inherits
> GdaDataModelHash) but it won't actually write back the modifications
> to the database for the simple reason that in most cases it won't know
> what to write, so the modified data cannot be used (except in some are
> cases).

I am fully aware of this (although other providers seem to have code to
write data back to the database, but I have not tested it).

Thing is that the GnomeDbGrid (and probably the form, too) already allow
modifications to the data even without this patch (this actually was why
I thought it should work), but fails when hitting the commit button.
Perhaps, an easier and more correct solution is to override is_updatable
in GdaSqliteRecordset and/or setting the read-only property to TRUE, so
that the GnomeDbGrid does just not allow editing the data.

> What I believe is better is to create a GdaDataModelQuery data model
> for which you'll give a SELECT query, and optionnally INSERT, UPDATE
> or DELETE queries so it knows how to actually write the data you
> modify back to the database.

This technique is already used in the more advanced examples. I just
want to show something working with libgnomedb with as less code as
possible.

Greetings,
Armin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF5u75hOtxKlDYm6cRAijFAJ42k7dp+1Bl2b4QwYE5rB4B9hDEIgCfXBzM
ki1pOjA0KE7PiD3uLHZMLTM=
=92HA
-----END PGP SIGNATURE-----



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]