Text field and module import questions
Greetings, It appears that the text input field I have created using a dtml method has a default space character when you click in the field. Is there a way to get rid of this? Also, I have a python script that I would like to import a python module, but when I run it Zope complains the user does not have authorization. Is there a way around this? Thanks. Ivan
Hi Ivan. Script Python scripts permit a limited number of modules to be used for security reasons. You will get these types of errors whenever you try to import a module that is not allowed. The best way to use other modules in Zope is by developing a product - like a simple tool product. You can import whatever modules you would like and place security restrictions on the methods you create (in a way that is consistent with how they will be used and who will use them). I think on zope.org you will find an example tool product and example content type products. I believe there are also examples of example plone and cmf products as well. This will be of interest if you are developing in one of these CMSs and provides a good starting point. If you search the archives of this list you may also find additional information on allowing specific modules into your Script Python since I recall this coming up before. From my perspective, the security measures in Zope are there to help you create secure applications. You can query the archives of this list at: http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/zope-List Regards, David
Also, I have a python script that I would like to import a python module, but when I run it Zope complains the user does not have authorization. Is there a way around this?
Ivan Stout wrote:
It appears that the text input field I have created using a dtml method has a default space character when you click in the field. Is there a way to get rid of this?
Depends on the HTML used; this is really a HTML question more than a DTML question. If this is a textarea, make sure there are no spaces between the opening and closing tags: <textarea ..attrs..></textarea> or, if you fill the textarea from with a dtml attribute, eliminate the spaces there too: <textarea ..attrs..>&dtml-variablename;</textarea> If you need multiple lines to avoid excessive wrapping or scrolling, put the angle brackets on a new line to eliminate whitespace (newlines are whitespace too!): <textarea ..attrs..
<dtml-var expression_or_variable ..attrs.. </textarea>
If you used an input tag, the same applies, but now to whitespace between the quotes of the value attribute. Martijn Pieters
Martijn, Thank you very much. Just as you said, there was a space in between openning and closing tags, but the reason I missed it was because I had indented like the following: _<textarea name="var"> _</textarea> since it was part of an if tag block. So I changed it like the following: _<textarea name="var"></textarea> Anyway, thanks again. I will pay much closer attention to how I format my code in the future. Cheers. On 9/19/05, Martijn Pieters <mj@zopatista.com> wrote:
Ivan Stout wrote:
It appears that the text input field I have created using a dtml method has a default space character when you click in the field. Is there a way to get rid of this?
Depends on the HTML used; this is really a HTML question more than a DTML question.
If this is a textarea, make sure there are no spaces between the opening and closing tags:
<textarea ..attrs..></textarea>
or, if you fill the textarea from with a dtml attribute, eliminate the spaces there too:
<textarea ..attrs..>&dtml-variablename;</textarea>
If you need multiple lines to avoid excessive wrapping or scrolling, put the angle brackets on a new line to eliminate whitespace (newlines are whitespace too!):
<textarea ..attrs..
<dtml-var expression_or_variable ..attrs.. </textarea>
If you used an input tag, the same applies, but now to whitespace between the quotes of the value attribute.
Martijn Pieters
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
David Pratt -
Ivan Stout -
Martijn Pieters