Hi Guys,

I created a custom comments app to make use of captcha. I didn't
change the mode, I just change the form to make use of django-simple-
captcha [1].

To make all magic works I need to do some hacks in django comments
framework. I want to use the existing views, I don't want to write it
myself, the problem is that the views refer to the form and the model
as:

    # Construct the comment form
    form = [django.contrib.]comments.get_form()(target, data=data)

Even with all settings configured and following the django docs, I can
find a way to make the views use COMMENTS_APP.get_form() reather than
comments.get_form(), so I did the hack:

    # Construct the comment form
    module = comments.get_comment_app()
    form = module.get_form()(target, data=data)

This way, all the things work like a charm, the form used to validate
the comments is my form and not comments form.

Am I missing something? Is there a correct way to do what I want?

Thanks for any help!

[1] http://code.google.com/p/django-simple-captcha/

--
Michel Sabchuk
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to