Friday, March 27, 2015

Re: Global access to request.user

I don't understand how middlware or filter would help on those cases.
Why not only pass the variable where it's needed?
On Fri 27 Mar 2015 at 10:18 guettli <hv@tbz-pariv.de> wrote:


Am Donnerstag, 26. März 2015 15:52:07 UTC+1 schrieb Anderson Resende:
You can use middlewares!!! It is a way...



I don't understand how middleware can help here.

The only way I see is that the middleware updates a global variable for the data. In my case request.user.

Anderson, is this what you meant?

This would work. But a lot of people say that you should not use global variables ....

Regards,
  Thomas Güttler

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/30c13358-9be7-40fc-87c3-5419d31b4b13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACPst9LrCABjwecJ3WjQFJRTHY%3Dq%2BMmyVEfLcHiMaHCkMGFaEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment