[Answer]-Access form's instance in django

1👍

From the documentation

Also, a model form instance bound to a model object will contain a
self.instance attribute that gives model form methods access to that
specific model instance.

def myview(request):
    if request.method == "POST":
        form = MyModelForm(request.POST,request.FILES)
        # form.instance -- this is the model

0👍

You can simply pass the form object off to the secondary view:

def view_one(request, slug):
    if request.method == 'POST':
        obj = get_object_or_404(Model, slug=slug)
        model_form = MyModelForm(request.POST, instance = obj)
        return view_two(request, form=model_form) 

def view_two(request, form=None):
    if form:
        obj = form.save(commit=False)
        obj.some_attribute = "Foo"
        obj.save()
        return render_to_response(...)

Leave a comment