I've had a look at MiddleKit (which looks fine) and the
WebKit/PostgreSQL examples from Ogg Vorbis (plain and simple, but with
a bit much code duplication), and I'm left with the desire to create a
generic wrapper at the level used in the Vorbis code, but with the
generality of MiddleKit (to avoid duplication).

It struck me that it probably ought to be possible to create a simple
class to handle this sort of mapping without any csv files or
code generation etc. It probably wouldn't be as complete, but it would
simply need three things:

  1. A table name (stored internally)
  
  2. A load method

  3. A store method

It could use __setattr__ and __getattr__ to keep the explicitly set
attributes (as opposed to methods etc) in a separate dictionary used
when storing etc. And the Python DB API has enough introspective
capabilities that no mapping needs to be explicitly specified.

Does this sound doable (and, if that, useful)?

 - Magnus (who might write it up if he gets some time)

--
Magnus Lie Hetland                                  The Anygui Project
http://hetland.org                                  http://anygui.org

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to