[Grok-dev] Re: Recipe for "egg-like" reuse?

Sebastian Ware sebastian at urbantalk.se
Wed Apr 9 07:18:53 EDT 2008


I did <include package="AddApp" /> (when it should have been "addapp")  
and when it didn't work I was trying other ways, eventually ending up  
with an entry

   <grok:grok package="protoncms" />

in configure.zcml. I have reverted to your suggestion and it works  
equally well. Now I am only struggling to get the grok.Permissions to  
work again. I have defined:

   class ViewContacts(grok.Permission):
     grok.name('protoncms.EditUser')

But I still get the error "Undefined permission 'protoncms.EditUser'".

Traceback (most recent call last):
   File "parts/app/runzope", line 112, in ?
     zope.app.twisted.main.main()
   File "/Users/jhsware/groksandbox/eggs/tmp6qlVKK/ 
zope.app.twisted-3.4.0a1-py2.4.egg/zope/app/twisted/main.py", line 74,  
in main
   File "/Users/jhsware/groksandbox/eggs/tmp6qlVKK/ 
zope.app.twisted-3.4.0a1-py2.4.egg/zope/app/twisted/main.py", line  
145, in setup
   File "/Users/jhsware/groksandbox/eggs/zope.app.appsetup-3.4.1- 
py2.4.egg/zope/app/appsetup/appsetup.py", line 111, in config
     context = xmlconfig.file(file, context=context, execute=execute)
   File "/Users/jhsware/groksandbox/eggs/tmp0uWzV7/ 
zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py",  
line 612, in file
   File "/Users/jhsware/groksandbox/eggs/tmp0uWzV7/ 
zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py", line  
610, in execute_actions
   File "/Users/jhsware/groksandbox/eggs/tmpQbfK7k/grok-0.11.1- 
py2.4.egg/grok/util.py", line 43, in make_checker
   File "/Users/jhsware/groksandbox/eggs/tmpQbfK7k/grok-0.11.1- 
py2.4.egg/grok/util.py", line 59, in check_permission
zope.configuration.config.ConfigurationExecutionError:  
martian.error.GrokError: Undefined permission 'protoncms.EditUser' in  
<class 'protoncms.protonuser.Edit'>. Use grok.Permission first.
   in:
   File "/Users/jhsware/groksandbox/Navicast/ProtonCMS/src/protoncms/ 
configure.zcml", line 4.2-4.27
     <grok:grok package="." />


Mvh Sebastian

9 apr 2008 kl. 12.51 skrev Uli Fouquet:

> Sebastian,
>
> Sebastian Ware wrote:
>> Now I am pretty sure that I am having problems with the grokking
>> process. If I move my edit view from AddApp to MasterApp then it is
>> found by the publisher and all is well.
>>
>> In other words views defined in MasterApp are working as expected,  
>> but
>> views defined in AddApp seem not to be registered. They are however
>> processed in some way since I will get an error if I choose a non-
>> existing class as grok.context().
>
> Did you include the necessary ZCML-fragment in your buildout.cfg as I
> told?
>
>    ...
>    <include package="addapp" /> <!-- NEW ENTRY -->
>    ...
>
> Otherwise your AddApp won't be grokked on startup. No views, no fun.  
> If
> you have defined an application in AddApp, this should also show up in
> the admin-UI then.
>
> Kind regards,
>
> -- 
> Uli
>



More information about the Grok-dev mailing list