I have a django template containing 2 buttons. One is for show and another is for print.
I am getting a list of objects from model to print. And there is a status field boolean in this model. The issue is after taking print, I want to update those objects by making their status field true . My code is here: def msss_loan_marking_print_for_period(request, template_name=None): site_prof = SiteProfile.objects.all() fin_year = site_prof[0].current_financial_year() context = {} data1=[] total=0 msss = request.session['cur_msss'] if request.method == 'POST': form = SentToBankReportForm(request.POST) if form.is_valid(): action = request.POST.get('action', None) from_date = form.cleaned_data.get('start_date') to_date = form.cleaned_data.get('end_date') category = form.cleaned_data.get('type') branch = form.cleaned_data.get('branch') sent_status = form.cleaned_data.get('sent_status') object = ShgGroupLoanMarking.objects.filter(sent_to_bank_status=False) if action=='print': context = { 'total': total, 'objects':objects, 'category': category, 'start_date': from_date, 'action': action, 'end_date': to_date, } template_name = 'report.html' objects.update(status=True) return pdf_utils.render_to_pdf_response(template_name, context, 'report.pdf') I understood that we cant update the field lik that(objects.update(status=True)) in this problem. Is there any solution to make the model objects updated through djamgo template?? -- 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+unsubscr...@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. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1f0d23a3-ab9e-4d7d-bd6c-cf8b2d3779d1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.