IntegrityError
I created a search box for searching the information about the client
so that this information uses to create the report.
def search(request):
query = request.GET.get('q', '')
if query:
results = Job.objects.filter(id =
query).values('client__client__name','client__client__address_1','clientjob__material__name','suspencejob__field__name','id','job_no','date','site','report_type',)
else:
results = []
return render_to_response("report/search.html", {"results":
results,"query": query})
I want to save the value of job in the report table to create a report like:
{% for job in results %}
<li>Job Id : {{ job.id }}</li>
<li>Name:{{job.client__client__name}}</li>
<li>Job No. : {{job.job_no}}</li>
<li>Site : {{job.site}}</li>
<li>Reference Letter No : {{job.Reference_Letter_no}}</li>
<li>Letter Date : {{job.Letter_date}}</li>
<li>Address : {{job.client__client__address_1}}</li>
<li>Material : {{job.clientjob__material__name}}</li>
<b><a href="{{ LOCAL_URL }}/automation/report/header/?id={{
job.id }}">Report</a></b>
{% endfor %}
i want to get job id to be saved through header view:
def header(request):
if request.method=='POST':
form = headForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
form.save()
return
HttpResponseRedirect(reverse('Automation.report.views.result'))
But get the following error:
IntegrityError at /report/header/
(1048, "Column 'job_id' cannot be null")
Please anybody tell me where i am wrong?
--
Satinderpal Singh
http://satindergoraya.blogspot.in/
http://satindergoraya91.blogspot.in/
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home