Hello everyone,

A few minor issues with association_proxy, especially wrt the
association object pattern.

The following points reference
http://www.sqlalchemy.org/docs/05/plugins.html

1) First, a typo. In section "Simplifying Association Object
Relations": "Because the proxies are backed a regular relation
collection" should have the word "by" or similar following "backed".

2) In section "Building Complex Views"

print broker.holdings[stock].shares
    # 10

Isn't holdings[stock] the share value? Ie. shouldn't this just be

print broker.holdings[stock]

?

3) The title "Simplifying Association Object Relations" appears twice
in
http://www.sqlalchemy.org/docs/05/plugins.html#plugins_associationproxy

4) A more general question:

I'm having difficulty parsing the last three lines in the itemized
list in Section "associationproxy".

"The relation is inspected ..." through "A creator funcion can be used..."

In particular, I'm having difficulty understanding the point of the
creator function in association_proxy. I see where creator functions are
defined (two places), but don't see them being used.

5) An even more general comment:

There are two discussions on mapping association objects. One of them
is in the mapper docs
(http://www.sqlalchemy.org/docs/05/mappers.html#advdatamapping_relation_patterns_association)
and uses a one-many and many-one relation. The second is in the docs
for association proxy
(http://www.sqlalchemy.org/docs/05/plugins.html#plugins_associationproxy_building),
two examples in "Simplifying Association Object Relations" and
"Building Complex Views", and uses association_proxy.

It looks like either of these approaches can be used to initialize and 
update the db. It might be helpful if these two could be connected 
somehow.  Perhaps a see also in the respective sections? I do see a "To 
enhance the association object pattern such that direct access to the 
Association object is optional, SQLAlchemy provides the associationproxy." 
in 
http://www.sqlalchemy.org/docs/05/mappers.html#advdatamapping_relation_patterns_association,
 
but it seems like you could just use the association_proxy setup described 
by itself, and it would suffice. The version in 
http://www.sqlalchemy.org/docs/05/mappers.html#advdatamapping_relation_patterns_association
 
says explicitly that this is the way to go - doesn't clearly point to 
alternatives.

Please cc me on any reply.
                                                    Thanks, Faheem.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to