0
I want to create a template for printing data but I’m a little lost on how to do this, I have a print name button, the same is found in a table that contains the customer name, telephone address etc ..., when clicking on it it should take the id of this client and the data of the same as name, phone, address ..., and put inside the print_page.html template, which will contain some more things like logo, company name ..., can anyone tell me if you have how to do this with Django direct in views or if I have to use javascript or something else?
I was trying to do direct in the views, but I finally noticed that my logic is not at all right I believe.
class PrintView(TemplateView):
template_name = 'core/print_page.html'
def get_context_data(self, **kwargs):
context = super(PrintView, self).get_context_data(**kwargs)
context['print_page'] = Client.objects.get(pk=self.pk)
return context
I did some research but I couldn’t find anything related to what I want.
Thanks in advance for any help.
Show vlw @Pablo.
– dhelbegor