|
|
|
|
|
|
Login
|
erp5.org has permanently moved to wiki.erp5.org ! Current status of ERP5 community websites:
Note: if you created content in this ancient portal, please migrate it to the wiki. The old website will stay online as long as all contents are not mograted to the wiki.
ZSQLMethod parameters and default values
A short description of what can be done with ZSQLMethods and parameters
ZSQLMethods in Zope allow to define parameters with default values. However, what can be done and the behaviour of such parameters is quite different with the behaviour of Python scripts. What can be done:
What can not be done:
Examples: param1 param2=toto param3="toto" param4="" param5=1 param1 has no default value. param2 and param3 have a default string value of toto. param4 has a default empty string value. param4 has a default string value of 1. Why use an empty string as default parameterThere is a major difference between:
<dtml-if param>
and:
<dtml-if "param">
In the second case, param must be defined in order to evaluate a python expression. In the first case, param does not need to be defined. Sometimes, we would like to do someting like:
<dtml-if param1 or param2 or param3>
However, this is not possible in dtml. So, we could do instead:
<dtml-if "param1 or param2 or param3">
and initialise param1, param2 and param3 to a default value equivalent to false: the empty string. |
|
|