#12742: File upload handler in Comments framework
---------------------------------------+----------------------------------
               Reporter:  sebzur       |          Owner:  nobody
                   Type:  New feature  |         Status:  new
              Milestone:               |      Component:  contrib.comments
                Version:  SVN          |       Severity:  Normal
             Resolution:               |       Keywords:  files
           Triage Stage:  Accepted     |      Has patch:  1
    Needs documentation:  1            |    Needs tests:  1
Patch needs improvement:  0            |  Easy pickings:  0
                  UI/UX:  0            |
---------------------------------------+----------------------------------

Comment (by thejaswi_puthraya):

 The reason for adding args and kwargs to the ``post_comment`` and then
 passing these to the form would be to allow users to send additional data
 and (say) from there on to the model (could be a custom comment).

 For example, with the deprecation of the RemoteAddrMiddleware, there is no
 standard way to fetch the IP address. The IP address could be passed as a
 kwarg to the form. This could prevent hacks like https://github.com/theju
 /django-comments-apps/blob/master/recaptcha_comments/views.py

 Another case, could be where the form's rendering depends on the request
 (or the session) and these could be passed through the args and/or kwargs
 (they can't be handled in the current case).

 For this ticket, the post_comment could be passed the request from which
 the request.FILES can be accessed.

 This patch will also solve quite a lot of #10838 and which requires the
 user to be passed.

 Just for the record, Alex (from a conversation on IRC) is not happy with
 passing args and kwargs to the post_comment view function. I have placed
 my arguments for the reason to include the args and kwargs and now the
 decision is left to you :)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/12742#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en.

Reply via email to