[Zope] Re: The word "students"

Josef Meile jmeile at hotmail.com
Thu Nov 18 17:39:44 EST 2004


Hi Asad,

Asad Habib wrote:
> Is the word "students" a reserved word in Zope? Apparently, I named a list
> "students" and then tried to populate it with the result set of a query.
> This variable was never populated and Zope did not generate an error.
> Also, I tested my query independently through phpMyAdmin and the Z SQL
> interface and it passed. When I changed the name of this variable from
> "students" to "studentNames", everything worked. Also, this is the only
> variable named "students" in my application. Your input would be
> appreciated. Thanks.
Are you working with DTML and ZClasses? If so, It could be that a
variable on a dtml method is being adquired from a ZClass or from other 
place. I had some similar problem and solve it just like you, renaming
the variable . If I'm not wrong, a way to avoid this is restricting the
name space on a dtml-with tag:

<dtml-with blah only>
   do something
</dtml-with>

If you use python products and ZPT, you will hardly have this problem
because you have to specify the object that contains the variable.
That's a reason why people here recommends not to use dtml: you have to
be careful about the name scope of your variables

Regards,
Josef


More information about the Zope mailing list