Monday, August 12, 2013

Creating an "Edit Page"

I've been struggling in creating an edit page and I need help, please!

The goal is to get the user to search a record and when they click on the link, I would like to use form.p with the values it finds from the database. 

For example if they search a name and click on the person that is already stored in the database, they should be redirected to a page where it shows a form with the person's information and the user should be able to edit and save the changes. 

I would appreciate any time of help to accomplish this. 

I've been thinking to do the following but I do not believe I'm on the right track:

     
html page
     <form enctype="multipart/form-data" action method="post" id="{{person.id}}">
<ul>
{{form.as_p}}
</ul>
<input type='submit' name='submit' value='save''>
</form>

view

      def person(request, person_id=1):   
           return render_to_response('edit.html', 
                              {'article': Data.objects.get(id=person_id) })

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate