From: | Matthew Story <matthewstory(at)gmail(dot)com> |
---|---|
To: | Pierre-Frédéric Caillaud <lists(at)boutiquenumerique(dot)com> |
Cc: | mstory(at)uchicago(dot)edu, pgsql-general(at)postgresql(dot)org |
Subject: | Re: PYTHON, ODBC |
Date: | 2005-01-09 20:02:45 |
Message-ID: | 63d038600501091202a8bf319@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
thanks for the advice,
matt
On Sun, 09 Jan 2005 20:47:08 +0100, Pierre-Frédéric Caillaud
<lists(at)boutiquenumerique(dot)com> wrote:
>
>
> > due to the complicated nature of the database, and inability of zope
>
> Well, I've found that Zope is very good to do a few things, and very bad
> at the rest.
>
> > to do what we need, and the problems with overhead we've been
> > experiencing with rails due to the size of the database. Hope this
>
> I like psycopy because selects with a lot of rows are processed
> efficiently.
>
> Look at the pydo library in the skunkweb project (google !)
>
> I'd advise you to start writing a base class for your database object
> (class DbObject) with a set of methods for setting instance methods from
> query results. SELECT * then use cursor.dictfetchall() which preserves the
> fields names !
> Add methods for inserting and updating.
> Add a mapping of fields to type converters (which are functions) to
> convert non-standard types like arrays to python lists if you need them.
>
> Then derive your DbObject class for each table, with class variables
> containing the field names and types converters, which will be used by the
> base class. This way you can have a derived class with almost no code.
>
> Enjoy !
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2005-01-09 20:18:00 | Re: Regexp matching: bug or operator error? |
Previous Message | Pierre-Frédéric Caillaud | 2005-01-09 19:47:08 | Re: PYTHON, ODBC |