wxGrid + SQLite?

Hello

  For those of you using databases (SQLite, but it's more general
question), how do use the wxGrid widget to display data from the DB,
let the user make changes, and then rewrite them to the DB?

Can wxGrid behave like a DB-aware widget in VB or Delphi, or do we
need to manually SELECT data out of the DB, and UPDATE/INSERT data
back?

Thank you.

Can wxGrid behave like a DB-aware widget in VB or Delphi, or do we
need to manually SELECT data out of the DB, and UPDATE/INSERT data
back?

You would need to retrieve your data and communicate with the grid
separately. IMHO it is better practice to handle your data and the
presentation thereof differently anyway,
so I certainly wouldn't view
this as a shortcoming if you are moving from a VB / Delphi background.

If user has to do more than he's used to do,
than it *IS* a shortcoming,
time is moving forward, not backwards ;-).

There would be a penalty on development time initially but data / presentation separation (e.g. Model-View-Controller) certainly saves far more time long term for maintenance costs.

···

--
Regards,
Wayne Koorts
Registered Linux User #330079

You assume that it's an either-or situation. Dabo provides complete
ui/logic/data separation, but includes data binding by setting a few
properties. The best of both worlds.

···

On Sun, Apr 27, 2008 at 3:01 PM, Wayne Koorts <wayne@wkoorts.com> wrote:

There would be a penalty on development time initially but data /
presentation separation (e.g. Model-View-Controller) certainly saves far
more time long term for maintenance costs.

--

# p.d.

Thanks guys for the input.

···

On Sun, 27 Apr 2008 10:34:00 -0500, "Peter Decker" <pydecker@gmail.com> wrote:

You should take a look at Dabo (http://dabodev.com), which wraps
wxPython with a much more Pythonic interface, making development much
smoother.

I'm using PostgreSQL for a database.

I much SELECT the data from the database and then UPDATE or INSERT to
put it back. However, I've written a series of Python classes that do
most of the work. Since, I'm fluent in SQL ,I write the SELECT SQL
statement, but the class knows how to write the data back. It's still a
work in progress, though.

···

On Sun, 2008-04-27 at 01:39 +0200, Gilles wrote:

        For those of you using databases (SQLite, but it's more
general
question), how do use the wxGrid widget to display data from the DB,
let the user make changes, and then rewrite them to the DB?

Can wxGrid behave like a DB-aware widget in VB or Delphi, or do we
need to manually SELECT data out of the DB, and UPDATE/INSERT data
back?

I wrote a wxPython program that can talk to Postgresql databases and uses
a grid to display selections from the database and also uses a grid
as a (very) simple editor for deleting/updating/adding records to the
database.

It comes with source code and some docs...You will need to add
a recent version of psycopg2 to your python library in order
to get the rascal to talk to postgresql.

http://homepage.mac.com/levanj/WxPython

Jerry

···

On May 1, 2008, at 3:15 PM, Mark Erbaugh wrote:

On Sun, 2008-04-27 at 01:39 +0200, Gilles wrote:

       For those of you using databases (SQLite, but it's more
general
question), how do use the wxGrid widget to display data from the DB,
let the user make changes, and then rewrite them to the DB?

Can wxGrid behave like a DB-aware widget in VB or Delphi, or do we
need to manually SELECT data out of the DB, and UPDATE/INSERT data
back?

I'm using PostgreSQL for a database.

I much SELECT the data from the database and then UPDATE or INSERT to
put it back. However, I've written a series of Python classes that do
most of the work. Since, I'm fluent in SQL ,I write the SELECT SQL
statement, but the class knows how to write the data back. It's still a
work in progress, though.