Python Webpages
Gerhard Häring
gerhard at bigfoot.de
Sun Apr 28 15:56:08 EDT 2002
* Magnus <nixx at telia.com> [2002-04-28 18:59 +0000]:
> [WebWare]
> Another powerful (not yet final though) module is Middlekit which e.g. makes
> it easy to deploy a servlet that acts with some glueware to e.g. MySQL.
The more I think about it, the less I get the point of object-relational
mappers like MiddleKit. Especially the ones that require you to rebuild
the database schema every time you change the object schema. AFAIC
MiddleKit falls into this category.
I think I'd prefer going either straight SQL with a dictionary mapper
(pyPgSQL's PgResultSet has such a thing built in [1]) or using an object
database like ZODB.
[1] in pyPgSQL, you can say, for example:
cursor.execute("select id, name from test")
print cursor.id, cursor.name
print cursor['id'], cursor['name']
print cursor[0], cursor[1]
All forms are equivalent, but only the last one is DB-API2 compliant.
Gerhard
--
mail: gerhard <at> bigfoot <dot> de registered Linux user #64239
web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9 3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))
More information about the Python-list
mailing list