[Answer]-Passing variables in django forms

1👍

Just try put the code of the GET method before the if request.method == POST. Something like this:

def acoplar_track(request, track_id, ):

//Code for GET here

if request.method == POST:

    //Code for POST here

//return render GET method

0👍

Let me rephrase your question, to make sure I understand:

You want to collect some information over several pages/forms, before saving a model.

This is covered in the documentation here:

https://docs.djangoproject.com/en/1.5/ref/contrib/formtools/form-wizard/

Basically, the information collected in earlier pages is actually saved in the database but in a different place, until you have all the info needed to save the model in which you’re interested. Then you can save the model and delete all the cached responses.

Leave a comment