Monday, January 2, 2012

Re: How to get current session user in models.py?

Inspecting your stack to find the user seems a pretty convoluted way to do it.

You could either a) not access users in your models b) explicitly pass the user around or c) just place your user into a local threading and retrieve it anywhere else for example: https://github.com/andymckay/arecibo/blob/master/listener/lib/userstorage/utils.py or any other methods for doing that.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate