0

Hello People here is my code

class FarticlesWizard(SessionWizardView):

def done(self,form_list,**kwargs):
    form_dict={}
    for x in form_list:
        form_dict=dict(form_dict.items()+x.cleaned_data.items())
    insert_db=Marticles(heading = form_dict['heading'],
    content = form_dict['content'],
    country=form_dict['country'],work=form_dict['work'],created_by=self.request.user)
    insert_db.save()
    return HttpResponseRedirect('/display/')

above code works fine by inserting data into database.. now i wanna update database for a particular 'id' is there a way to fix it? iam id through urls.py

url(r'^create/(?P<id>\d+)/$', FarticlesWizard.as_view([F1articles, F2articles])),

above url looks like this

http://MyIp/create/12/

as you can see id=12,now how to update databse for a particular Id??

1 Answer 1

1

use obj = Obj.objects.get(pk = some_id) get the id and for displaying use render

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.