[z3-five] AddMenuItem in five

Daniel de la Cuesta cues7a at yahoo.es
Tue Sep 12 10:26:17 CEST 2006



Lennart Regebro <regebro at gmail.com> escribió: On 9/12/06, Daniel de la Cuesta  wrote:

> Finally, when I run zope I get the following error in my configure.zcml
> file:
>
>  NameError: name '_' is not defined

Then you have, somewhere in your python files, used _ without defining it.
_ is not a magic name, although it looks magic. It's just a variable
that needs to be defined just like everything else.

It's usually defined to MessageFactory('domainname') and used for translations.
Ok, problem solved. The problem was the declaration of the schema in the inferfaces.py module. This is the correct form:

text = Text( 
          title=u"Text", 
          description=u"The text of the example.", 
          required=True)

Instead of:

text = Text( 
          title=_u("Text)", 
          description=_u("The text of the example."), 
          required=True)



Now I have another problem :-(:

I have my product registered (I can see it in the listo of products in the ZMI), and I have my product in the drop and down list of available items to add.

When I add an instance of my product I get the following error in the ZMI:

    Zope has encountered a problem publishing your object. Cannot locate object at: http://localhost:8080/temp_folder/%2B/main_module_addform

This error refers to the following lines of the ZMI:

<browser:addform
    ...
    name="main_module_addform"
     ...
</browser:addform>

<five:registerClass
    ...
    addview="main_module_addform"
/>

Maciej told me that main_module_addforms are view but where do I have to implement them?
Is this the equivalent manage_addMain_ModuleForm and manage_addMain_Module?
Do I have to implement then like in zope 2?
Do I have to create and html page to view the form?


I have a lot of doubts about that,

Thank you

 		
---------------------------------

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codespeak.net/pipermail/z3-five/attachments/20060912/c0e2c1af/attachment.htm 


More information about the z3-five mailing list