Hi, I've just spent the last few hours looking around Django site, and google and the mailing lists for any hints on the following problem.
I need to implement functionality similar to that of the django.contrib.sites module, the difference being that value of what would be the SITE_ID setting, needs to be obtained from the current session. The basic idea is that I would like to automatically filter model results based on the contents of a list of elements in the request variable. Lets for the purposes of this discussion, call it a Container. So person browses site, gets assigned a blank list of containers. During login the users list of containers gets populated. In terms of the existing sites module, this step is the equivalent of setting SITE_ID to a list of IDs (yes I'm aware that it would make no sense to do so, but I'm saying this in terms of logic, not semantics). Any requests for model data then that the user needs to modify or view then gets filtered based on the values of this list of containers. I'm kind of a newbie to Django. Am I right in thinking the best way to accomplish this if it is possible is by using a combination of model managers and middleware? Is it at all possible to get any data provided by middleware into the managers or are the managers one way elements? I've found some hints on this usergroup which involve middleware that writes to threadlocal elements that looked promising, but I don't know if this will work with mod_python or not. Will this work, or does this sound like a Django Faux Pax? Any advice would be appreciated and may carry beertokens redeemable on an Island in the Mediterranean. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---