Hi guys,
I am using django for my webapplication which is based in python.
When I am submitting a form, using views.py wihch is
i get this error
any idea as to why this is happening?
cvdb that is being passed into get_object is globally defined. its one of my models from my app
"from portal.cm.model s import cvdb"
but i get a local error.
any suggestions would be appreciated! thankkk you
I am using django for my webapplication which is based in python.
When I am submitting a form, using views.py wihch is
Code:
def cvdetails(request, id): cvdb = get_object_or_404(cvdb, id=id) <-- [B]error happening here[/B] if request.method == 'POST': f = cvform(instance=cvdb, data=request.POST) if f.is_valid(): f.save() else: f = cvform(instance=cvdb) return render_to_response('cm/cvdetails.html', context_instance=RequestContext(request, {'form': f}))
Code:
UnboundLocalError at /cm/1/cv/ local variable 'cvdb' referenced before assignment Request Method: GET Request URL: http://lab.cpcstrans.com/cm/1/cv/ Exception Type: UnboundLocalError Exception Value: local variable 'cvdb' referenced before assignment
cvdb that is being passed into get_object is globally defined. its one of my models from my app
"from portal.cm.model s import cvdb"
but i get a local error.
any suggestions would be appreciated! thankkk you
Comment