Re: Editing model instance

2012-11-23 Thread Sandeep kaur
On Fri, Nov 23, 2012 at 7:25 PM, Victor Rocha wrote: > For starters, I see more than one thing wrong with your code. I hope thats > not the one your actually using and it was just a typo when you asked the > question. > + jform = editJobForm(request.POST, instance=job) # job

Re: Editing model instance

2012-11-23 Thread Victor Rocha
This would be the code I would like you to try: def editjob(request): clientjob = ClientEditJob.objects.get(job_id =query) #adjust query as needed job = EditJob.objects.get(job_id=query)#adjust query as needed if request.method == "POST":

Re: Editing model instance

2012-11-23 Thread Victor Rocha
For starters, I see more than one thing wrong with your code. I hope thats not the one your actually using and it was just a typo when you asked the question. + jform = editJobForm(request.POST, instance=job) # job has not being defined. Also when you instantiate your form, you want to use and

Re: Editing model instance

2012-11-22 Thread Sandeep kaur
On Thu, Nov 22, 2012 at 5:32 PM, Sergiy Khohlov wrote: > you can set values in form via form __init__ > Values of some other instance? How? -- Sandeep Kaur E-Mail: mkaurkha...@gmail.com Blog: sandymadaan.wordpress.com -- You received this message because you are

Re: Editing model instance

2012-11-22 Thread Sergiy Khohlov
you can set values in form via form __init__ 2012/11/22 Sandeep kaur : > On Thu, Nov 22, 2012 at 4:54 PM, Sergiy Khohlov wrote: >> Have you tried to change instances to your new tables ? >> > If I try instance of new table, I won't get the old

Re: Editing model instance

2012-11-22 Thread Sandeep kaur
On Thu, Nov 22, 2012 at 4:54 PM, Sergiy Khohlov wrote: > Have you tried to change instances to your new tables ? > If I try instance of new table, I won't get the old values that I need to edit. -- Sandeep Kaur E-Mail: mkaurkha...@gmail.com Blog: sandymadaan.wordpress.com

Re: Editing model instance

2012-11-22 Thread Sergiy Khohlov
Have you tried to change instances to your new tables ? 2012/11/22 Sandeep kaur : > I edit value of a table using model instance, however after editing I > want the values to be saved in some other table with same structure. > For this to happen I have used following code

Editing model instance

2012-11-22 Thread Sandeep kaur
I edit value of a table using model instance, however after editing I want the values to be saved in some other table with same structure. For this to happen I have used following code in views.py : def editjob(request): clientjob = ClientJob.objects.get(job_id = query)