Hi Bro.·.If I understand you, you can this:def any_func(..., request):....filter(created_user=request.user)Cheers Bro.·.
----
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF1jwZEtTYiD%3DTvPxuvucMRV%2BeLzCD%3DXMWdMSKt2sV2fbxYeMA%40mail.gmail.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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPF44MAtRpPmNgF%2BpDHbcemRHP30tDtCgp-S0Hoae%3DAdJw_7xQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Hi Bro.·.If I understand you, you can this:def any_func(..., request):....filter(created_user=request.user)Cheers Bro.·.
On Fri, Aug 17, 2018 at 1:22 PM Fellipe Henrique <fell...@gmail.com> wrote:
--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF1jwZEtTYiD%3DTvPxuvucMRV%2BeLzCD%3DXMWdMSKt2sV2fbxYeMA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
make a custom model manager for that model.
--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/63e2765e-96a6-4283-ba6b-7c8ac5f25cb3%40googlegroups.com.
Thanks Jason,But, can I get current user on model manager? I need to filter with that info.T.·.F.·.A.·. S+FFellipe Henrique P. Soarese-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'Fedora Ambassador: https://fedoraproject.org/wiki/User:FellipehBlog: http:www.fellipeh.eti.brGitHub: https://github.com/fellipehTwitter: @fh_bash
On Sat, Aug 18, 2018 at 9:10 AM Jason <jjohn...@gmail.com> wrote:
make a custom model manager for that model.--
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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/63e2765e-96a6-4283-ba6b-7c8ac5f25cb3%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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF1jwZEoRS0%3DqOmoOcViUH_HseiLTe1670p6i%3DMQYBxG%2BYeKjA%40mail.gmail.com.
What you can do is add a middleware that sets the current user in a thread local variable. That way you can then add a custom model manager that reads that variable.Then all of your filters will be set automatically.
Regards,Andréas
2018-08-18 17:46 GMT+02:00 Fellipe Henrique <fell...@gmail.com>:
Thanks Jason,But, can I get current user on model manager? I need to filter with that info.T.·.F.·.A.·. S+FFellipe Henrique P. Soarese-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'Fedora Ambassador: https://fedoraproject.org/wiki/User:FellipehBlog: http:www.fellipeh.eti.brGitHub: https://github.com/fellipehTwitter: @fh_bash
On Sat, Aug 18, 2018 at 9:10 AM Jason <jjohn...@gmail.com> wrote:
make a custom model manager for that model.--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/63e2765e-96a6-4283-ba6b-7c8ac5f25cb3%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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF1jwZEoRS0%3DqOmoOcViUH_HseiLTe1670p6i%3DMQYBxG%2BYeKjA%40mail.gmail.com.
--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK4qSCfOVv3K_kzbT_F1yaheHbH5sECdOp70nNcMi-3_m%3DtDXw%40mail.gmail.com.
Regards,Andréas
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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/63e2765e-96a6-4283-ba6b-7c8ac5f25cb3%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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF1jwZEoRS0%3DqOmoOcViUH_HseiLTe1670p6i%3DMQYBxG%2BYeKjA%40mail.gmail.com.
--
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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK4qSCfOVv3K_kzbT_F1yaheHbH5sECdOp70nNcMi-3_m%3DtDXw%40mail.gmail.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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF1jwZGzK-Yd1qQb9FHY_3196bNjr_nsRkpraR5xB%2BwaTMxp%2Bg%40mail.gmail.com.