On Tuesday 14 April 2009 16:56:41 Dusty Phillips wrote: > On Apr 13, 5:16 pm, a...@svilendobrev.com wrote: > > > mapper(Document, documents, properties={ > > > 'document_id': documents.c.id, # document_id ORM property > > > In the past, I have successfully mapped these properties using > > > synonym, but this time I'm confused because I'm not sure how to > > > define the synonym to a different column name. How do I change > > > my 'document_id': declaration in the mapper call to set up the > > > above descriptor when accessing the id column on the table? > > > > if u use '_document_id' in above mapper(..) would that be enough? > > no synonim, just diff.property-name > > Wouldn't that mean that any session queries would have to be on > '_document_id' too? yes > I'd rather have the queries on the property > name -- 'document_id'. well, then the above and doc=synonym( _doc, ...)
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---