coulix wrote:
> however i feel like i am heading the wrong way, i saw that if a user
> si logged in the email and user field of comment model will be
> automatically assigned.

Yes, they are.

> Therefore maybe i just have to custom the form template instead of
> customising the forms.py and models.py since i want to remove not add
> fields ?

That's what I do, and it seems to work :-) I simply have:
     {% if user.is_authenticated %}
     {% get_comment_form for production as form %}
     <form action="{% comment_form_target %}" method="post">
     ...
     </form>
     {% endif %}

where ... includes (apart from HTML text) form.comment, 
form.honeypot.label_tag, form.honeypot, form.content_type, 
form.object_pk, form.timestamp, form.security_hash and a hidden next.

I also have a wrapper around post_comment in order for only logged-in 
users to post:
     def post_comment_wrapper(request):
         if not request.user.is_authenticated():
             return HttpResponseRedirect(<url>)
         return post_comment(request)

ATB,
Matthew


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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