Re: updating data in a row

2015-01-12 Thread sum abiut
Thanks heaps James, It works perfectly . :) Cheers, On Tue, Jan 13, 2015 at 12:48 PM, James Schneider wrote: > In your update_form.html, change the action to: > > action="" > > This will cause the form to POST to the same URL that generated the form, > which should be what you want. > > More s

Re: updating data in a row

2015-01-12 Thread James Schneider
In your update_form.html, change the action to: action="" This will cause the form to POST to the same URL that generated the form, which should be what you want. More specifically, you don't have access to {{a.id}} in update_form.html (since this is a separate request from the one that generate

Re: updating data in a row

2015-01-12 Thread sum abiut
I am having a slight issue. click on the edit to working fine but when i make change ans click save. i get this error Page not found (404) Request Method: POST Request URL: http://10.0.x.x:8000/update_form// i think something is not right on th update_from.html. i just can't seem to figure it ou

Re: updating data in a row

2015-01-12 Thread sum abiut
Hi James, Thanks heaps for your help. your help is very much appreciated . I manage to fix my issue. I wouldn't have done it without your help. :) Cheers. On Tue, Jan 13, 2015 at 10:24 AM, sum abiut wrote: > Hi James, > > I have already coding the two views my problem is updating the rows. I

Re: updating data in a row

2015-01-12 Thread sum abiut
Hi James, I have already coding the two views my problem is updating the rows. I am a bit confuse on how to get that done. Cheers, On Mon, Jan 12, 2015 at 4:27 PM, James Schneider wrote: > You'll need two views to do this, one of them is the form, and that you > already have written. Have yo

Re: updating data in a row

2015-01-11 Thread James Schneider
You'll need two views to do this, one of them is the form, and that you already have written. Have you read through the tutorial? It explains how to use an FBV (which seem to be your preference, which is fine) to create the other view that lists one or more objects in a table format: https://docs.

Re: updating data in a row

2015-01-11 Thread sum abiut
Basically my table structure look something of this type. I want to be able to allow users to click on edit and to make changes to to the table. just wondering if for loop can do the trick? i am a bit confuse. Update First Name Last Name Position Department Leave Type edit

Re: updating data in a row

2015-01-11 Thread Edgar Gabaldi
add or update multiple rows, maybe you should see a little about formsets[1]. [1] https://docs.djangoproject.com/en/1.7/topics/forms/formsets/ On Mon, Jan 12, 2015 at 12:30 AM, sum abiut wrote: > I want to be able to click on a row, update it and then click on another > row update it and so on.

Re: updating data in a row

2015-01-11 Thread sum abiut
I want to be able to click on a row, update it and then click on another row update it and so on. On Mon, Jan 12, 2015 at 12:58 PM, sum abiut wrote: > Thanks very much Vijay its works. But it doesn't really solve my problem, > because i want to be able to edit more than one rows in a table not j

Re: updating data in a row

2015-01-11 Thread sum abiut
Thanks very much Vijay its works. But it doesn't really solve my problem, because i want to be able to edit more than one rows in a table not just one row. any help will be very much appreciated. Cheers, On Mon, Jan 12, 2015 at 11:38 AM, Vijay Khemlani wrote: > If you changed the url mapping

Re: updating data in a row

2015-01-11 Thread Vijay Khemlani
If you changed the url mapping then you need to include the id of the newleave in the URL you are accessing, for example http://10.0.X.X:8000/update_form/1/ On Sun, Jan 11, 2015 at 7:27 PM, sum abiut wrote: > Hi James, > > I am try to visit this url http://10.0.X.X:8000/update_form/ > > > > her

Re: updating data in a row

2015-01-11 Thread sum abiut
Hi James, I am try to visit this url http://10.0.X.X:8000/update_form/ here is the traceback: Request Method: GET Request URL: http://10.0.x.x:8000/update_form/ Django Version: 1.7.1 Python Version: 2.7.6 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contr

Re: updating data in a row

2015-01-08 Thread James Schneider
What URL are you visiting and can you post the traceback? On Jan 8, 2015 9:25 PM, "sum abiut" wrote: > Hi, > I have change the URL mapping to url(r'^update_form/(?P\d+) > /$', 'eLeave.views.update_form'), > > but i am getting the error > > Page not found (404) > > any advise i am getting this er

Re: updating data in a row

2015-01-08 Thread sum abiut
Hi, I have change the URL mapping to url(r'^update_form/(?P\d+) /$', 'eLeave.views.update_form'), but i am getting the error Page not found (404) any advise i am getting this error? cheers On Fri, Jan 9, 2015 at 3:20 PM, Vijay Khemlani wrote: > You have two choices > > 1. Change the URL ma

Re: updating data in a row

2015-01-08 Thread Vijay Khemlani
You have two choices 1. Change the URL mapping and pass the "id" in the url url(r'^update_form/(?P\d+)/$', 'eLeave.views.update_form'), (then the url is something like /update_form/15/) 2, Change the view so that it only accepts the "request" argument def update_form(request): in that case yo

Re: updating data in a row

2015-01-08 Thread sum abiut
hi James, here is the url.py url(r'^update_form/$', 'eLeave.views.update_form'), On Fri, Jan 9, 2015 at 2:19 PM, James Schneider wrote: > Looks like you aren't sending enough arguments to your view from the URL > dispatcher. What does your urls.py look like? > > -James > On Jan 8, 2015 6:4

Re: updating data in a row

2015-01-08 Thread James Schneider
Looks like you aren't sending enough arguments to your view from the URL dispatcher. What does your urls.py look like? -James On Jan 8, 2015 6:49 PM, "sum abiut" wrote: > > Hi, > i am trying to update data in a row from an existing database but i keep > getting this error. > > update_form() take

updating data in a row

2015-01-08 Thread sum abiut
Hi, i am trying to update data in a row from an existing database but i keep getting this error. update_form() takes exactly 2 arguments (1 given) can someone advise what i am missing here. here are my code: view.py def update_form(request, id): if request.method == 'POST': a=newl