On Feb 1, 2014, at 11:50 AM, Adrian Robert <adrian.b.rob...@gmail.com> wrote:

> Hi,
> 
> I'm new to sqlalchemy though I've used other ORMs (e.g. Hibernate) before, 
> and I'm trying to use the new automap feature.
> 
> However it seems to be using the foreign table name rather than a suffixed 
> version of the column name when naming relationships.  Is there a reason for 
> doing it this way?

this is only a default.   All the naming schemes are configurable as documented 
at 
http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/automap.html#overriding-naming-schemes
 .  In this case you’d be doing the name_for_scalar_relationship callable: 
http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/automap.html#sqlalchemy.ext.automap.name_for_scalar_relationship

> If the naming needs to be done this way for general consistency with how 
> things are done elsewhere in sqlalchemy,

SQLAlchemy avoids automatic naming schemes like the plague, and there are very 
few places they are present.  This extension is clearly one of them as it is 
necessary, but it’s entirely open ended.   

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to