[Grok-dev] Re: Recipe for "egg-like" reuse?
Sebastian Ware
sebastian at urbantalk.se
Wed Apr 9 03:42:46 EDT 2008
8 apr 2008 kl. 21.41 skrev Martijn Faassen:
> Sebastian Ware wrote:
>> 8 apr 2008 kl. 17.33 skrev Uli Fouquet:
>>> If you want your AddApp to be registered completely, edit
>>> buildout.cfg
>>> and register your additional app in the [app] section::
>> I have come to the point where I can create an instance of my
>> MasterApp in the grok admin interface. However, the application
>> won't find the views I have in my AddApp, eventhough the
>> application class of MasterApp has inherited from a class of AddApp
>> for which these views should be registered (through grok.context).
>
> I don't see evidence of this in your example: the Edit view is
> attached to the ProtonCMS model, which doesn't inherit from Navicast
> at all.
Actually the base functionality that I wanted to reuse is implemented
in AddApp. In other words, I did a "grokproject MasterApp" and then
manually copied AddApp.
Is there any way I can double check that AddApp has been grokked? I
was thinking that this could be the problem. I am missing both my
defined grok.View and grok.Permissions and they were all defined in
app.py of AddApp.
>
>
>> MasterApp:
>> class Navicast(grok.Application, ProtonCMS):
>> [snip]
>> AddApp:
>> class ProtonCMS(grok.Container):
>> [snip]
>> class Edit(grok.EditForm, protonbase.ProtonEdit):
>> grok.context(ProtonCMS)
>> [snip]
>> And I would expect to be able to access the edit view through:
>> http://localhost:8080/application/edit
>> But I get a "The page that you are trying to access is not available"
>
> If you want to *extend* the MasterApp program from your AddApp
> program, you need to either share the class you extend, or the
> interface. You'll have to do either one of these:
I have tried using Interfaces, but it didn't make any difference,
hence me thinking that it might be something with the grokking processs.
mvh Sebastian
More information about the Grok-dev
mailing list