[Grok-dev] Re: avoiding ZODB breakage
Philipp von Weitershausen
philipp at weitershausen.de
Wed Jun 11 04:29:38 EDT 2008
Martijn Faassen wrote:
>> a) introduce a module alias (if you've moved a whole module)
>> b) or provide BBB imports in the old module
>> Both aren't hard, in fact b) is pretty straight-forward. I don't think
>> it gets any easier. You just have to *know* that you have to do it.
>> That's really the trickiest part, I think.
> The trickiest part will be easier if we make it absolutely trivial. I
> think we should make it so the user doesn't have to care whether they
> moved the whole module or not. I also don't want to tell people how they
> should mess around sys.modules themselves to make module aliases (as I
> understand a) still requires).
> What about something like this?
> class Foo(grok.Model):
> grok.moved('foo.bar.baz', class_name='Bar')
> so, if you move any class, you can indicate with grok.moved that you
> moved it.
Yup, why not. Could also be a module-level directive, then it would set
up a module alias for the whole module.
More information about the Grok-dev