Yes, of course. I am already working things around in order to get what I 
need.

Now, the database backed SessionStore defines a method 
"create_model_instance(self, data)" which is called from 
"django.contrib.sessions.middleware.SessionMiddleware". Django docs invite 
to redefine this method in order to populate the custom session with the 
required data.

My question is: would it be okay to formally ask that the request object, 
which is already available there, be passed to that method when called, 
like " create_model_instance(self, data, request=None)"?

El miércoles, 15 de abril de 2020, 17:01:30 (UTC-4), Tim Graham escribió:
>
> Can't you copy whatever data you want from the request into the session 
> data (request.session.<whatever> = request.<whatever>) in a view, 
> middleware, or wherever? That seems like the proper separation of concerns.
>
> On Wednesday, April 15, 2020 at 11:50:13 AM UTC-4, Lorenzo Peña wrote:
>>
>> Now, in order to follow the path suggested in the Django documentation 
>> for overriding database backed sessions, some of the data one might need to 
>> store in the session model is coming from the request, and Django is not 
>> passing the request when instantiating the session store.
>>
>> Do you think there is a point in requesting that the request object (if 
>> available) is passed as an optional parameter when creating the session?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/9047b481-9127-4c50-b5da-34b7fd6f7b47%40googlegroups.com.

Reply via email to