couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <fdman...@gmail.com>
Subject Re: Accessing design doc from view server code?
Date Tue, 16 Feb 2010 17:25:15 GMT
Chris,

looking at render.js:

  function runShow(fun, ddoc, args) {
    try {
      resetList();
      Mime.resetProvides();
      var resp = fun.apply(ddoc, args) || {};

The scope under which the show function is executed is in fact the design
doc. Same goes for _list, _update and _validate.



On Tue, Feb 16, 2010 at 1:56 AM, J Chris Anderson <jchris@gmail.com> wrote:

>
> the design doc is available in the view server (in everything but map and
> reduce functions), but it's not exposed to the sandbox (yet).
>
> I'd like to make it so the design doc is the value of 'this' when you are
> inside _show, _list, etc functions.
>
> This would be a small patch if anyone is up for it.
>
> Chris
>
> >
> >
> > Cheers,
> >
> > Zach
>
>


-- 
Filipe David Manana,
fdmanana@gmail.com
PGP key - http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC569452B

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message