Skip to content

Python code snippet – How to pass data between views django?

def update_project_filter(request):
    ...
    selected_project_id = project_form.cleaned_data["Project_Name"].id
    request.session['selected_project_id'] = selected_project_id
    ...

def update_project(request):
    ...
    selected_project_id = request.session.get('selected_project_id')
    ...
See also  How to sum numbers of a list in Python without sum?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.