#24165: add request.messages attribute
----------------------------------+--------------------------------------
     Reporter:  collinanderson    |                    Owner:  nobody
         Type:  New feature       |                   Status:  new
    Component:  contrib.messages  |                  Version:  master
     Severity:  Normal            |               Resolution:
     Keywords:                    |             Triage Stage:  Unreviewed
    Has patch:  1                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+--------------------------------------

Comment (by collinanderson):

 `request.user` has been there since day 1
 
https://github.com/django/django/commit/ed114e15106192b22ebb78ef5bf5bce72b419d13
 #diff-461e26928e3d218ad38c12d949a512a8R79

 It's more of a proposal (yeah, maybe I should put it on the mailing list
 instead). I also figure we're doing that anyway behind the scenes.  I've
 used custom attributes of request a lot myself and it's worked well. One
 big advantage is being able to use the same syntax in views and templates.

 But yes, it's mostly to allow avoiding context_processors :) The template
 tag wouldn't work quite as well in this case, because it needs the request
 object. You would need to say `{% load messages %}{% get_messages request
 as messages %}` which I personally think is a bit verbose, but I might be
 open to it.

 I'm also fine with holding off for now.

--
Ticket URL: <https://code.djangoproject.com/ticket/24165#comment:3>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/072.a9f1e7332b66dd941a5123abc382bd2a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to