hello everyone,

I'm trying to recreate reCaptcha ( http://recaptcha.net/learnmore.html ) 
in newforms. Trouble is: I want this to be represented by a sinlge Field 
inside a form and then do the API calls in the clean() of that Field.

This is how this field/widget should render:

<script type="text/javascript" 
src="http://api.recaptcha.net/challenge?k=<your_public_key>&error=<error 
code>">
</script>
<noscript>
    <iframe src="http://api.recaptcha.net/noscript?k=<your_public_key>"
        height="300" width="500" frameborder="0"></iframe><br>
    <textarea name="recaptcha_challenge_field" rows="3" cols="40">
    </textarea>
    <input type="hidden" name="recaptcha_response_field"
        value="manual_challenge">
</noscript>

I started trying out subclassing the MultiWidget with a custom render 
(as the API error needs to be passed on to the widget!), but I got stuck 
somewhere halfway.

I know I could use the templating and put all of this in a template or 
possibly a template tag, but wouldn't it be superb if I could do:

class CaptchaTest(forms.Form):
     captcha = ReCaptchaField()
     something_else = ...

which would get automatic Captcha checking.


An additional problem is that for the ReCaptchaField.clean() I need the 
ip of the person who did the post. How can I pass this without making 
the captcha a dynamic field inside the CaptchaTest __init__?


Lots of questions again!


  - bram

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to