These are chat archives for django/django

14th
Nov 2016
Miracle Ayodele
@iammiracle
Nov 14 2016 11:08
any django expert online?
Francis Mwangi
@mwaaas
Nov 14 2016 12:03
Hi guys quick question on Session on Ussd protocol. so here the client sends session id on the request payload not on http header. So when I do session = SessionStore('my_session_key') then I don session.session_key its None. I have tried to understand this code https://github.com/django/django/blob/master/django/contrib/sessions/backends/base.py#L38, https://github.com/django/django/blob/master/django/contrib/sessions/backends/db.py#L13
I can't see where the session_key is set to None if its not in django_session table.
Any one to help in this
Mark Heppner
@mheppner
Nov 14 2016 18:49
@mwaaas Not sure what exactly you’re trying to do, but I think you’d want to use a different middleware. If the client is sending the session id in the request data, then you’d want to subclass SessionMiddleware and let process_request() pull it out of your request data instead of the cookie. I’m not sure why you’re looking at the db backend for it, but it’s just a normal query set. In the load() function, it’s calling Session.objects.get(session_key), so if it doesn’t exist, it’ll return None, just like any other query set.
Ismael Venegas Castelló
@SalchiPapa
Nov 14 2016 23:15
Hello everyone!

Newbie question! I'd like to create a form to input patient data in order to store them in a database, I already have this, my question is how to create a new form that requests either the ID or patient name and then make it search in the database in order to pour the record contents into a view, for the user to be able to edit and update (if needed), could you recommend me any tutorial?

I've been looking for a while, but I can't seem to find exactly what I'm looking for, thanks in advance! :smile:

Ismael Venegas Castelló
@SalchiPapa
Nov 14 2016 23:28
No one is answering, well maybe it was a stupid question sorry to bother
Is there a more active django channel you guys could recommend?