[sqlalchemy] Examples for Index() in 07Migration wiki

2011-04-22 Thread Yap Sok Ann
In the 07Migration wiki, there is this line: Index('name', name=idx_name) which doesn't work for me. I have to change it to: Index('idx_name', 'name') Is it a typo or some python 3 only syntax? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To

[sqlalchemy] replacing or altering a mapper?

2011-04-22 Thread Iain Duncan
Hi folks, hoping someone can help here, couldn't figure it out from the mapper docs. I have some mappers being created in modules that are loaded separately. That has to stay that way, essentially our framework has base modules that get reused and they have ZCA utilities registered that make

Re: [sqlalchemy] replacing or altering a mapper?

2011-04-22 Thread Michael Bayer
On Apr 22, 2011, at 7:18 PM, Iain Duncan wrote: Hi folks, hoping someone can help here, couldn't figure it out from the mapper docs. I have some mappers being created in modules that are loaded separately. That has to stay that way, essentially our framework has base modules that get reused

Re: [sqlalchemy] Examples for Index() in 07Migration wiki

2011-04-22 Thread Michael Bayer
On Apr 22, 2011, at 2:05 AM, Yap Sok Ann wrote: In the 07Migration wiki, there is this line: Index('name', name=idx_name) which doesn't work for me. I have to change it to: Index('idx_name', 'name') its a typo as an Index only has one name, its the first arg. Is it a typo or

[sqlalchemy] Re: replacing or altering a mapper?

2011-04-22 Thread Iain Duncan
mappers only support the addition of new attributes after construction.   There is of course clear_mappers() but that removes the entire graph of mappers (emphasis on graph, which is why we don't get into the surgical removal of individual mappers).   There is also the prospect of creating

Re: [sqlalchemy] Re: replacing or altering a mapper?

2011-04-22 Thread Michael Bayer
On Apr 22, 2011, at 10:16 PM, Iain Duncan wrote: mappers only support the addition of new attributes after construction. There is of course clear_mappers() but that removes the entire graph of mappers (emphasis on graph, which is why we don't get into the surgical removal of

Re: [sqlalchemy] Re: replacing or altering a mapper?

2011-04-22 Thread Iain Duncan
mappers only support the addition of new attributes after construction. There is of course clear_mappers() but that removes the entire graph of mappers (emphasis on graph, which is why we don't get into the surgical removal of individual mappers). There is also the prospect of creating

Re: [sqlalchemy] Re: replacing or altering a mapper?

2011-04-22 Thread Michael Bayer
On Apr 22, 2011, at 10:58 PM, Iain Duncan wrote: Right, I didn't do a thorough job of explaining it, so I agree with the your assessment of the monkey patch, but my pattern isn't quite what you described ( because of my poor explanation! ). I'm using Pyramid and taking advantage of the