I'm trying to get my first content-type working and I have some problems. For the record, I'm following Stephan great book and I'm running Zope 3.2.0 on Windows.

My content-type represents a Provider and is quite simple. The first problem I have is when I try to run the tests with the following code:

c:\path\to\my\instance\bin\test -vpu --dir z:\my_root_app_dir
[ traceback ]
ImportError: No module named z:.my_root_app_dir

So I go to the z:\ dir and try another form:

c:\path\to\my\instance\bin\test -vpu --dir my_root_app_dir
Running tests at level 1
Total: 0 tests, 0 failures, 0 errors

So no tests found. But when I run this command:

Z:\>c:\python24\python my_root_app_dir\tests\test_provider.py
Ran 1 test in 0.010s


It *runs* 1 test. What am I doing wrong?

Second question: When I register my content-type in Zope using a configure.zcml in the root directory and a browser package with its own configure.zcml everything seems to work fine. I can see an entry in the Add menu for my content type.

When I click on that entry I see a nice autogenerated form for the Provider. I fill some fields and click the Add button and then I get a security exception:

ForbiddenAttribute: ('name', <my_root_app_dir.provider.Provider object at 0x034A2730>)

I'm logging in as the only principal in my zope instance which is the one created with the mkzopeinstance script. In the configure.zcml file of the browser subpackage I have this code:

      label="Add Provider"
      fields="name phone address email"

Any help is greatly appreciated.


Lorenzo Gil
Zope3-users mailing list

Reply via email to