I want to create a template for printing data but I'm kind of lost in how to do this, I have a print name button, it's in a table that contains the customer's name, phone number, in it it should take the id of this client and the data of the same as name, phone, address ..., and put inside the template print_page.html, which will contain some more things like logo, company name ..., someone can you tell me if you have how to do this with direct django in views or if I have to use javascript or something else?
I was trying to make direct in the views, but I ended up noting 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 have researched but found nothing related to what I want.
Thanks in advance for any help.