Something like this?:
def index():
use_recaptcha = True
recaptcha_public = "..."
recaptcha_private = "..."
captcha = lambda f,v: Recaptcha(request,
recaptcha_public,recaptcha_private) if use_recaptcha else ''
form = SQLFORM.factory(Field('test',requires=IS_NOT_EMPTY()),
Field('test2',widget=captcha)
)
if form.accepts(request.vars,session):
response.flash = "Got it"
return dict(form=form)
Or if you don't need it in form.custom you can just insert it into the
form:
def index():
use_recaptcha = True
recaptcha_public = "..."
recaptcha_private = "..."
captcha = Recaptcha(request, recaptcha_public,recaptcha_private)
form = SQLFORM.factory(Field('test',requires=IS_NOT_EMPTY()),Field
('test2'))
if use_recaptcha:
form[0].insert(-1, TR('', captcha, ''))
if form.accepts(request.vars,session):
response.flash = "Got it"
return dict(form=form)
On Nov 21, 8:12 am, Thadeus Burgess <
thade...@thadeusb.com> wrote:
> And access it through custom form with..
>
> {{=form.custom.widget.recaptcha}}
>
> -Thadeus
>