durusmail: quixote-users: Question about _q_getname
Question about _q_getname
2002-01-24
2002-01-24
2002-01-24
2002-01-24
2002-01-25
2002-01-25
Question about _q_getname
Greg Ward
2002-01-24
On 23 January 2002, David Ascher said:
> Given a url path a/b/c, if a is a "simple function" and b, and c are
> dynamic (hence require _q_getname involvement at some point) -- what is
> the sequence of attribute lookups and method calls which results in the
> response?

I believe that if a is a simple function, Quixote will go no further: it
will call a() and return its result bundled up in an HTTP response.  The
string "/b/c" should be accessible to a() somewhere in its request
object, but I wouldn't promise it.

To use _q_getname(), 'a' needs to be a namespace: most commonly a module
or class instance.  (Yes, *I* know that functions now have attributes.
Quixote does not know this, though, and I don't think that should
change.  Functions are 99% callable and 1% namespace.)  _q_getname()
would then be an attribute of 'a', ie. a function if 'a' is a module,
and a method if 'a' is an instance.

Is clear like mud, no?

        Greg
--
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org


reply