Re: [SQLObject] Re: Impressions so far
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Ian B. <ia...@co...> - 2003-06-03 06:44:15
|
On Fri, 2003-05-30 at 21:48, Ian Bicking wrote:
> I've only looked at Modeling a bit. But ouch... those functions and
> methods are painful to read, not to mention write. Like:
>
> from Modeling.FetchSpecification import FetchSpecification
> from Modeling.Qualifier import qualifierWithQualifierFormat
>
> qualifier=qualifierWithQualifierFormat('lastName=="Hugo"')
> fetchSpec=FetchSpecification(entityName='Writer', qualifier=qualifier)
> objects=ec.objectsWithFetchSpecification(fetchSpec)
>
> That's a "simple" fetch. Hurts my head just having that on the page. Oh my:
>
> aBook.addObjectToBothSidesOfRelationshipWithKey(anAuthor, 'author')
After a little thought, and in Modeling's defense, I have a feeling this
is because the API was taken from an Object C ORM, where these method
names don't look quite so odd. More like:
aBook addObjectToBothSidesOfRelationship: anAuthor withKey: "author"
OK... "addObjectToBothSidesOfRelationship" is still a little long, but
this sort of method name is more common in that world. It still could
stand to be translated into better Python -- "withX" shouldn't be used,
for instance, instead it should be key='author' -- but at least it's
more understandable.
Ian
|