[Zope] confused about optional args to ZSQL methods
Paul Winkler
pw_lists@slinkp.com
Thu, 5 Dec 2002 08:57:28 -0800
On Thu, Dec 05, 2002 at 10:31:02AM -0600, Skip Montanaro wrote:
>
> Ulrich> "id" is obviously a very bad name for a user variable in
> Ulrich> Zope.
>
> Obvious to who?
"Obvious" is always debatable... but here's my thoughts on this issue:
every object in the ZODB has an id attribute which can be
accessed by its getId() method, and which is used to qualify which
object within a folder (or other ObjectManager) you want, e.g.
http://my_zope_server:8080/foo/bar/getId
...or in python...
context.foo.bar.getId()
... or just...
context.foo.bar.id
... either one yields the string "bar".
In python I'd say id might be ok to use as a variable name,
as long as you don't mind hiding that builtin (which would
be reason enough for me not to do it.)
As for dtml, <dtml-var id> already means something:
it's equivalent to context.id in
a python script. And your original question referred to DTML.
So I wouldn't ever define "id" in a dtml situation.
--
Paul Winkler
http://www.slinkp.com
"Welcome to Muppet Labs, where the future is made - today!"