From user-return-22342-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Oct 3 21:11:37 2012 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 00F73D9E4 for ; Wed, 3 Oct 2012 21:11:37 +0000 (UTC) Received: (qmail 19682 invoked by uid 500); 3 Oct 2012 21:11:35 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 19645 invoked by uid 500); 3 Oct 2012 21:11:35 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 19632 invoked by uid 99); 3 Oct 2012 21:11:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2012 21:11:35 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ryan.ramage@gmail.com designates 74.125.83.52 as permitted sender) Received: from [74.125.83.52] (HELO mail-ee0-f52.google.com) (74.125.83.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2012 21:11:28 +0000 Received: by eekb57 with SMTP id b57so3907596eek.11 for ; Wed, 03 Oct 2012 14:11:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=qpJs330XVq0xgM+JDGm51QAEmPAVrVxsaNLb7j0fS6k=; b=jG/cuxWdVQArm5zzTb1J296x9hi2DrS+XHsTFonHcdc3LmeQlP3q50a0jhNxPDu2EW f5ygyI4HOgNErVIDHqcSbD/H9j6UrHvdBeKnNwROcfmCGhklroFMyIDQ2poh8+YQRejy 9Cz2T6YFsBlakXZuU4Zo4k1Y2pViABxLmjUMIA+ViBrIOInDNXRV8zCwjjdeXYoTLubM 9Y2e7YdrS0WDwDbqZHkQm6qEHRVLKvKdxXw4OUte6tdH0oopgTBE0gqGaps6temphYRR Es8fhQ76fKx1bvXnuM6iEAOt8hoHhbK+Qdw1UKa3MKenaCBRCyjV3PyB6+yVuZz2pJLu 8sew== MIME-Version: 1.0 Received: by 10.14.176.66 with SMTP id a42mr4606852eem.1.1349298667580; Wed, 03 Oct 2012 14:11:07 -0700 (PDT) Received: by 10.14.188.132 with HTTP; Wed, 3 Oct 2012 14:11:07 -0700 (PDT) In-Reply-To: References: Date: Wed, 3 Oct 2012 15:11:07 -0600 Message-ID: Subject: Re: How do you access design_doc functions from a validation function? From: Ryan Ramage To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hey Marcus, You can't access attachments from your validation function. But what you could do is put it in the design doc and as an attachment (if you still need it as an attachment). Then you can use commonjs to access the js. http://wiki.apache.org/couchdb/CommonJS_Modules On Wed, Oct 3, 2012 at 2:39 PM, Wordit wrote: > I need to access an external javascript function from the validation function. > The function lives as an attachment in a design_doc. How do I include > it so the validation function can access it? > > Many Thanks, > > Marcus