how do I make a query for this issue ? in django - python

I'm having a 2 models Zone and DailyTask So I want to make a table in the front end(HTML)
that like image is shown below. U is used_tasks UN is unused_tasks T total_tasks
I want list this data for each zones for the currusponding timeslots this is my current code
model one Zone
class DailyTask(models.Model):
date = models.DateField()
zone = models.ForeignKey(Zone, on_delete=models.SET_NULL, null=True)
slot = models.ForeignKey(GeneralTimeSlot,related_name='daily_task', on_delete=models.CASCADE)
total_tasks = models.IntegerField(default=0)
used_tasks = models.IntegerField(default=0)
unused_tasks = models.IntegerField(default=0)
available_driver_slots = models.ManyToManyField(DriverTimeSlot)
model two Zone
class Zone(models.Model):
name = models.CharField(max_length=200)
coordinates = models.TextField(null=True, blank=True)
time slot view.py
def get(self, request, *args, **kwargs):
zones = Zone.objects.all()
today = datetime.date.today()
daily_task = DailyTask.objects.filter(date="2022-06-04")
return render(request, self.template_name, {'zones': zones, 'daily_tasks': daily_task})
template timeslotreport.html
{% extends 'macro-admin/base.html' %}
{% load crispy_forms_tags %}
{% block title %}
<title>Time Slot Report</title>
{% endblock %}
{% block content %}
<style type="text/css">
table {
border-collapse: collapse;
width: 100%;
}
td, th {
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
.button1 button{
border: 2px solid #3783b5;
border-radius: 5px;
padding: 5px 15px;
margin: 2px 0;
background-color: white;
width: 80px;
}
.under{
text-decoration:underline;
}
.order2 .card-title{
font-size: 25px!important;
}
.order2 button{
float: right;
padding: 10px 80px!important;
}
.marg{
padding-top: 50px;
}
.marg .row{
padding: 10px;
border-bottom: 1px solid #ece4e4;
}
.settle h4{
float: right;
padding: 5px 20px;
border: 2px solid #3783b5;
border-radius: 10px;
font-size: 15px;
}
.settle2 h4{
float: left;
padding: 5px 20px;
border: 2px solid #3783b5;
border-radius: 10px;
font-size: 15px;
}
input#birthday {
padding: 8px 10px!important;
min-width: 144px!important;
margin: 0 10px!important;
border-radius: 5px!important;
border: 1px solid #3f57ff!important;
background: #3f57ff!important;
color-scheme: dark!important;
}
</style>
<div class="container-fluid">
<div class="card" >
<div class="card-header order2">
<a class="card-title">
Time Slot Report
</a>
</div>
</div>
<div class="col-lg-12 col-md-12">
<div class="row my-2">
<div class="col-12 d-flex justify-content-md-center sort-index">
<form class="form-inline" action="/action_page.php">
<input type="date" id="birthday" name="birthday">
</form>
</div>
</div>
</div>
<hr>
<div class="card">
<!--<div class="card-header">
<h4 class="card-title">
Default
</h4>
</div> -->
<div class="card-body">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Time Slots</th>
{% for z in zones %}
<th scope="col">{{ z.name }}</th>
{% endfor %}
<th scope="col">Total used</th>
<th scope="col">Total unused</th>
<th scope="col">Total</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="col"></th>
{% for z in zones %}
<th scope="col">U / Un / T</th>
{% endfor %}
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
{% for zone in zones|slice:":1" %}
{% for task in daily_tasks %}
{% if task.zone.id == zone.id %}
<tr>
<th class="align-middle text-center" scope="row">{{ task.slot.start_time.time }} - {{ task.slot.end_time.time }}</th>
{% for zo in zones %}
{% if task.zone.id == zone.id %}
<td class="align-middle text-center">{{ task.used_tasks }} / {{ task.unused_tasks }} / {{ task.total_tasks }}</td>
{% endif %}
{% endfor %}
</tr>
{% endif %}
{% endfor %}
{% endfor %}
</tbody>
</table>
</div>
</div>
<th class="align-middle text-center" scope="row">08:00:00AM - 09:00:00AM</th>
</tr>
<tr>
<th class="align-middle text-center" scope="row">09:00:00AM - 10:00:00AM</th>
</tr>
<tr>
<th class="align-middle text-center" scope="row">10:00:00AM - 11:00:00AM</th>
<td class="align-middle text-center">
{% for zone in zones %}
{% if zone.name == "Zone A" %}
{{ zone }}
{% endif %}
{% endfor %}
</td>
</tr>
<tr>
<th class="align-middle text-center" scope="row">12:00:00PM - 01:00:00PM</th>
</tr>
<tr>
<th class="align-middle text-center" scope="row">04:00:00PM - 05:00:00PM</th>
</tr>
<tr>
<th class="align-middle text-center" scope="row">05:00:00PM - 06:00:00PM</th>
</tr>
<tr>
<th class="align-middle text-center" scope="row">06:00:00PM - 07:00:00PM</th>
</tr>
<tr>
<th class="align-middle text-center" scope="row">07:00:00PM - 08:00:00PM</th>
</tr>
<tr>
<th class="align-middle text-center" scope="row">08:00:00PM - 09:00:00PM</th>
</tr>
<tr>
<th class="align-middle text-center" scope="row">09:00:00PM - 10:00:00PM</th>
</div>
<div class="card-body bg-fade">
<div class="d-flex align-items-center justify-content-center">
<nav aria-label="Page navigation" class="mr-3">
<ul class="pagination m-0">
<li class="page-item">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">«</span>
<span class="sr-only">Previous</span>
</a>
</li>
<li class="page-item active"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">»</span>
<span class="sr-only">Next</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
the result i want is data on this image

Related

How to generate PDF in Django in other than English?

i am trying to generate pdf using xhtml2pdf in django for other than english but it shows black square boxes and unusual texts.
i am trying to render nepali text in my pdf but i m getting this issue, can anyone help me to solve this issue ,,
import imp
from io import StringIO
# from weasyprint import HTML
from django.template.loader import render_to_string
import tempfile
from django.http import HttpResponse
from django.conf import settings
import datetime
# A stream implementation using an in-memory bytes buffer
# It inherits BufferIOBase
from django.http import HttpResponse
from django.template.loader import get_template
from xhtml2pdf import pisa # a html2pdf converter
def render_to_pdf(template_src, context_dict={}):
"""
This method will converts the template file into pdf
#params template_src is the template file to be converted
#params context_dict is the dictionary containing all the data written into the template
"""
template = get_template(template_src)
context_dict.update(
{
"invoice_title": context_dict["invoice_title"]
+ str(datetime.datetime.now())
+ ".pdf"
}
)
# this will render the html template and parse the data into the template
html = template.render(context_dict)
# result = StringIO()
response = HttpResponse(content_type="application/pdf")
response["Content-Disposition"] = (
"inline;attachment; filename="
+ context_dict["invoice_title"]
+ str(datetime.datetime.now())
+ ".pdf"
)
response["Content-Transfer-Encoding"] = "utf8"
# part will create the pdf.
# pdf = pisa.pisaDocument(BytesIO(html.encode("ISO-8859-1")), result)
pisa_status = pisa.pisaDocument(html.encode("UTF-8"), response)
# pisa_status= pisa.CreatePDF(
# html, dest=response
# )
if pisa_status.err:
return HttpResponse("We had some errors <pre>" + html + "</pre>")
return response
html template:
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Purchase Invoice</title>
<style>
.heading {
font-size: 12px;
font-display: bold;
text-align: center;
padding-top: 50px;
}
.subheading {
font-size: 12px;
text-align: center;
}
.col-12 {
width: 100%;
float: left;
}
.col-3 {
width: 25%;
float: left;
}
.col-6 {
width: 50%;
float: left;
}
.textalignright {
text-align: right;
font-size: 12px;
}
.detail {
font-size: 12px;
/* font-weight: bold; */
}
table,
th,
td {
border: 1px solid black;
border-collapse: collapse;
padding: 3px 3px 0px 3px;
}
.w-5 {
width: 10%;
}
.w-25 {
width: 50%;
}
</style>
</head>
<body>
<div class="container">
<div class="Company_profile">
<div class="row">
<div class="col-12 heading">
<h1 class="text-white">{{request.user.company.print_name}}</h1>
</div>
</div>
<div class="row">
<table style="width:100%; border:none;">
<tr style="border:none;">
<td style="width:33.33%; border:none;"></td>
<td style="width:33.33%; border:none; text-align:center;">Email : {{request.user.company.email}}
</td>
<td style="width:33.33%; border:none; text-align:right;">Times Printed :1</td>
</tr>
<tr style="border:none;">
<td style="width:33.33%; border:none;"></td>
<td style="width:33.33%; border:none; text-align:center;">VAT Registration No: {{request.user.company.it_pan}}</td>
<td style="width:33.33%; border:none; text-align:right;">Copy of Original</td>
</tr>
</table>
</div>
<div class="row">
<div class="col-12 subheading">
<h3 class="float-left">कर बिजक</h3>
</div>
</div>
</div>
<div class="Customer_info">
<div class="row">
<table style="width:100%; border:none;">
<tr style="border:none;">
<td style="width:50%; border:none;" class="detail">Invoice No.:{{purchase_data.voucherno}}</td>
<td style="width:50%; border:none; text-align:right;" class="detail">Invoice Date :{{purchase_data.formatted_nepalidate}}</td>
</tr>
<tr style="border:none;">
<td style="width:50%; border:none;" class="detail">Customer Name:{{purchase_data.party.name}}</td>
<td style="width:50%; border:none;"></td>
</tr>
<tr style="border:none;">
<td style="width:50%; border:none;" class="detail">Customer Address :{{purchase_data.party.address}}</td>
<td style="width:50%; border:none;"></td>
</tr>
<tr style="border:none;">
<td style="width:50%; border:none;" class="detail">Customer's VAT/PAN No:{{purchase_data.party.it_pan}}</td>
<td style="width:50%; border:none;"></td>
</tr>
</table>
</div>
</div>
<br />
<br />
<div class="Sales_detail">
<table style="width:100%;">
<thead>
<tr>
<th class="w-5">S.N</th>
<th class="w-25">Particulars</th>
<th class="w-5">Qty</th>
<th class="w-5">Unit </th>
<th class="w-5"> Price</th>
<th class="w-5">Amount</th>
</tr>
</thead>
<tbody>
{% for purchaseItem in purchase_items %}
<tr>
<td scope="row">{{ forloop.counter }}</th>
<td>{{purchaseItem.item.name}}</td>
<td>{{purchaseItem.quantity}}</td>
<td>{{purchaseItem.unit.name}}</td>
<td>{{purchaseItem.formatted_price}}</td>
<td>{% if purchase_data.is_line_discount %}{{purchaseItem.formatted_amount}}{% else %}{{purchaseItem.formatted_amount}}{% endif %}</td>
</tr>
{% endfor %}
<tr>
<td colspan="5" style="text-align:left;">Total Amount</td>
<td>{{purchase_data.total_amount}}</td>
</tr>
<tr>
<td colspan="5" style="text-align:left;">Discount Amount</td>
<td>{{purchase_data.trade_discount_amount}}</td>
</tr>
<tr>
<td colspan="5" style="text-align:left;">Total Taxable Amount</td>
<td>{{purchase_data.taxable_amount}}</td>
</tr>
<tr>
<td colspan="5" style="text-align:left;">13% VAT</td>
<td>{{purchase_data.vat_amount}}</td>
</tr>
<tr>
<td colspan="5" style="text-align:left; font-weight:Bold;">Total NPR Incl. VAT</td>
<td style="font-weight:Bold;">{{purchase_data.total_amount_inc_vat}}</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-12 detail">
<p><b>Total Amount in Words :</b> {{purchase_data.formatted_amountwords}}
</p>
</div>
</div>
</div>
<div class="footer" style="margin-top:100px ;">
<table style="width:100%; border:none;">
<tr style="border:none;">
<td style="width:100%; border:none;">
<p class="text-left">(E. & O. E) Goods once sold are not exchangeable or returnable.</p>
</td>
</tr>
<tr style="border:none;">
<td style="width:50%; border:none;"></td>
<td style="width:50%; border:none; text-align:right;">-----------------------------</td>
</tr>
<tr style="border:none;">
<td style="width:50%; border:none;"></td>
<td style="width:50%; border:none; text-align:right;">Authorised Signatory</td>
</tr>
<tr style="border:none;">
<td style="width:50%; border:none;"></td>
<td style="width:50%; border:none; text-align:right;">Printed On : {{purchase_data.formatted_nepalidate}}</td>
</tr>
<tr style="border:none;">
<td style="width:50%; border:none;"></td>
<td style="width:50%; border:none; text-align:right;">Printed By: {{request.user.username}}</td>
</tr>
</table>
</div>
</div>
</body>
</html>
I am getting this output with black square but not the text:

I am trying to correctly make a block row within a table in a report

I'm trying to do a block tr inside an HTML table using the Python Jinja library for Front-end. The table appears to me with the following appearance:
El código HTML es el siguiente:
<body>
<div id="testName">
{{ ca['name'] }}
</div>
<br>
<div id="testDates">
Start test Date: <span>{{ ca['start_ca'] | time_str }}</span>
<br>
End test Date: <span>{{ ca['end_ca'] | time_str }}</span>
</div>
{% for stage in ca['stages'] %}
<table class="blueTable">
<tbody style="page-break-inside: auto;" >
<tr id="rowOne">
<th style="font-weight:bolder;">Stage</th>
<th colspan="5">Start Date</th>
<th colspan="5">End Date</th>
</tr>
<tr id="rowTwo">
<td >{{ stage.name }}</td>
<td colspan="5">{{stage.start | time_str}}</td>
<td colspan="5">{{stage.end | time_str}}</td>
</tr>
<tr style="background-color: #1C6EA4; color: white;">
<th>Step ID</th>
<th>Step</th>
<th>Start Date</th>
<th>End Date</th>
<th>Expected</th>
<th>Found</th>
<th>Not Found</th>
<th>Expected Ok</th>
<th>Ok</th>
<th>Fails</th>
<th>Overall</th>
</tr>
{%for step in stage.steps%}
<tr id="filaBucle">
<th rowspan='{{ step[1] | size }}'>
{{step[0]}}
</th>
{%for s in step[1]%}
<th >{{s.name}}</th>
<td>{{s.start | time_str}}</td>
<td>{{s.end | time_str}}</td>
<td style="color:darkblue;">{{s.expected}}</td>
<td style="color:green;">{{s.found}}</td>
<td style="color:red;">{{s.not_found}}</td>
<td style="color:darkblue;">{{s.expected_ok}}</td>
<td style="color:green;">{{s.ok}}</td>
<td style="color:red;">{{s.fails}}</td>
{% if s.overall < 50 %}
<td style="color: red;">{{s.overall}}%</td>
{% elif 50 <= s.overall < 100 %}
<td colspan="1" style="color: brown;">{{s.overall}}%</td>
{% else %}
<td style="color: green;">{{s.overall}}%<br></td>
{% endif %}
{% endfor %}
</tr>
{% if step[1] | has_errors %}
<tr style="color: #F3E9EB;background-color: #8E8585; border-style: hidden;">
<th colspan="11"> Errors Details</th>
</tr>
{%for s in step[1]%}
{% if s.error_detail %}
<tr style="color: #D22020; background-color: #D3C9C9;">
<th colspan="2">Step ID: {{s._id}}</th>
<th colspan="9"> {{s.name}}</th>
</tr>
{% for detail in s.error_detail %}
<tr style="color: #D22020; background-color: #D3C9C9;">
<td colspan="11"> {{detail | replace("\n", "<br>")}}</td>
</tr>
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table>
{% endfor %}
I have tried to do everything possible with the CSS, but everything is out of place and I can't put those rows as subsections of the first column where it is numbered

Django - chart won't display values correctly

The goal here is to show each bar corresponding to association and total members as displayed below:
What I get is this one big block with no value.
Seems that no one has the same issue here that I have been looking for.
Still a newbie so appreciate all your help & guidance, folks!
models.py
class Member(models.Model):
member_no = models.AutoField(primary_key=True)
association = models.ForeignKey('Association')
...
class Association(models.Model):
asoc_name = models.CharField(max_length=50, null=True, blank=True)
class Meta:
db_table = 'Association'
def __str__(self):
return self.asoc_name
def __unicode__(self):
return self.asoc_name
class AssociationSummary(Association):
class Meta:
proxy = True
verbose_name = 'Association Summary'
verbose_name_plural = 'Association Summary'
admin.py
#admin.register(AssociationSummary)
class ChartAssociationAdmin(admin.ModelAdmin):
change_list_template = 'admin/chart_association.html'
def changelist_view(self, request, extra_context=None):
response = super(ChartAssociationAdmin, self).changelist_view(
request,
extra_context=extra_context,
)
try:
qs = response.context_data['cl'].queryset
except (AttributeError, KeyError):
return response
metrics = {
'association': Count('asoc_name'),
'total': Sum('member'),
}
response.context_data['summary'] = list(
qs.values('asoc_name', 'member').annotate(**metrics)
)
response.context_data['summary_total'] = dict(
qs.aggregate(**metrics)
)
summary_over_time = qs.values('asoc_name', 'member').annotate(total=Sum('member'))
summary_range = summary_over_time.aggregate(
low=Min('total'),
high=Max('total'),
)
high = summary_range.get('high', 0)
low = summary_range.get('low', 0)
response.context_data['summary_over_time'] = [{
'asoc_name': x['asoc_name'],
'total': x['total'] or 0,
'pct':\
((x['total'] or 0) - low) / (high - low) * 100
if high > low else 0,
} for x in summary_over_time]
return response
chart_association.html
{% extends 'admin/change_list.html' %}
{% block content_title %}
<h1> Association Summary </h1>
{% endblock %}
{% block result_list %}
<div class=”results”>
<table>
<thead>
<tr>
<th>
<div class=”text”>
<span>Association</span>
</div>
</th>
<th>
<div class=”text”>
<span>Total Members</span>
</div>
</th>
</tr>
</thead>
<tbody>
{% for row in summary %}
<tr class="{% cycle 'row1' 'row2' %}">
<td> {{ row.asoc_name }} </td>
<td> {{ row.total }} </td>
</tr>
{% endfor %}
</tr>
<tr style="font-weight:bold; border-top:2px solid #DDDDDD;">
<td> Total </td>
<td> {{ summary_total.total }} </td>
</tr>
</tbody>
</table>
</div>
<br>
<h2> Association Chart </h2>
<style>
.bar-chart {
display: flex;
justify-content: space-around;
height: 160px;
padding-top: 60px;
overflow: hidden;
}
.bar-chart .bar {
flex: 100%;
align-self: flex-end;
margin-right: 2px;
position: relative;
background-color: #79aec8;
}
.bar-chart .bar:last-child {
margin: 0;
}
.bar-chart .bar:hover {
background-color: #417690;
}
.bar-chart .bar .bar-tooltip {
position: relative;
z-index: 999;
}
.bar-chart .bar .bar-tooltip {
position: absolute;
top: -60px;
left: 50%;
transform: translateX(-50%);
text-align: center;
font-weight: bold;
opacity: 0;
}
</style>
<div class="results">
<div class="bar-chart">
{% for x in summary_over_time %}
<div class="bar" style="height:{{x.pct}}%">
<div class="bar-tooltip">
{{ x.total | default:0 }}<br>
{{ x.asoc_name }}
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}
{% block pagination %}{% endblock %}

How to set html file converted from html to PDF using weasyprint to 100% of page width and height

Code I'm using for PDF generation:
html = HTML(string=final_html, base_url=request.build_absolute_uri())
main_doc = html.render()
pdf = main_doc.write_pdf()
This is the content of final_html string:
<body style="width:100%; height:100%;">
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
table {
margin-top: 0px;
}
th, td {
padding: 5px;
}
.bottom {
vertical-align: bottom;
}
tr.noBorder td {
border: 0;
}
</style> <table style="width:100%; height:100%;">
<tr>
<td COLSPAN="2" style="border-right-style: hidden;">
<div style="float: left; display:inline;">
<div>
<div><strong>-seller_name-</strong></div>
</div>
</div>
</td>
<td COLSPAN=2>
<div style="float: right; display:inline;">
<div style="text-align: center">
<strong>-label_name-</strong>
</div>
<div>
-crnbarcodeimage-
</div>
<div style="text-align: center">
<strong>*-label_number-*</strong>
</div>
</div>
</td>
</tr>
<tr>
<td COLSPAN=2>Name & Delivery Address</td>
<td style="border-right-style: hidden;">Payment Mode</td>
<td style="float: right; border-left-style: hidden; border-top-style: hidden; border-bottom-style: hidden;">
<strong>-order_type-</strong></td>
</tr>
<tr>
<td COLSPAN=2>
<div><strong>-drop_name-</strong></div>
<br>
<div>-drop_address-</div>
<br>
<div>-drop_state- <strong>-drop_pincode-</strong></div>
<br>
<div><strong>Contact Number: -drop_phone-</strong></div>
</td>
<td valign="top" COLSPAN=2>
<div style="float: left;">
<strong>Order No.:</strong>
</div>
<div style="float: right;">
-seller_order_id-
</div>
<div>
<div>
-seller_order_id_barcode-
</div>
</div>
<div style="float: left;">
<strong>Invoice No.</strong>
</div>
<div style="float: right;">
-invoice_number-
</div>
</td>
</tr>
<tr>
<td COLSPAN=4 ALIGN=RIGHT>
</td>
</tr>
<tr>
<td>Description</td>
<td>QTY</td>
<td>Rate</td>
<td>Amount</td>
</tr>
<tr>
<td>-item-</td>
<td>1</td>
<td>-invoice_value-</td>
<td>-invoice_value-</td>
</tr>
<tr>
<td COLSPAN=3 ALIGN=LEFT style="border-right-style:hidden;">Total</td>
<td COLSPAN=1 ALIGN=LEFT style="border-left-style:hidden;">-invoice_value-</td>
</tr>
<tr>
<td COLSPAN=3 ALIGN=LEFT style="border-right-style:hidden;"><strong>COD Amount</strong></td>
<td COLSPAN=1 ALIGN=LEFT style="border-left-style:hidden;"><strong>-cod_value-</strong></td>
</tr>
<tr>
<td COLSPAN=4>
Prices are inclusive of all applicable taxes
</td>
</tr>
<tr>
<td COLSPAN=4 style="border-bottom-style:hidden;">If Undelivered, please return to:</td>
</tr>
<tr>
<td COLSPAN=4>
<strong>
<div>B-220/2, 1st Floor, Right Door, Savitri Nagar, New Delhi: 110017 Ph. 8376035546</div>
</strong>
</td>
</tr> </table> </body> </html>
The pdf is always generated as partial of the page while I want it to cover entire pdf page.
I think that you might have to add this to your styles to configure the page:
#page {
size: 11cm 14.1cm;
margin-left: 0.5cm;
margin-top: 0.5cm;
}

First page blank when multiple pages rendered?

I use pisa for print from html to pdf. And I have a problem.
if amount of data few, than print in first page. if amount of data more, than he print in next page, but first page is empty.
What do you think about it?
Please help me
table {
-pdf-keep-with-next: true;
}
#page {
size: letter portrait;
margin-right: 30pt;
margin-left: 30pt;
}
#frame content_frame {
left: 50pt;
width: 512pt;
top: 50pt;
height: 692pt;
}
context = Context(context_dict)
html = template.render(context)
result = StringIO.StringIO()
pisa.CreatePDF(html.encode("UTF-8"), result, encoding='UTF-8', link_callback=self.fetch_resources)
response = HttpResponse(result.getvalue(), mimetype='application/pdf')
response['Content-Disposition'] = 'attachment; filename=report-%s-%s.pdf' % (start_date, end_date)
RequestContext(request)
<tbody>
<tr class="text-center">
<td>{% trans "Date" %}</td>
<td class="padding-top-5">
<p class="text-center"> {% trans "Journal" %} </p>
<p style="margin: 0 5pt;">{% trans "history, status, diagnosis and treatment for the treatment of recurrent disease" %}</p>
</td>
<td>{% trans "Doctor" %}</td>
</tr>
{% for reception in receptions %}
<tr>
<td class="text-center" style="width: 30%; vertical-align: top">
<p class="separator"> </p>
{{ reception.date_created|date:"d F Y" }}
</td>
<td>
<div style="padding: 5px">
{% if reception.result|length_is:0 or reception.result == None %}
{% else %}
{{ reception.result|linebreaks }}
{% endif %}
</div>
<td style="vertical-align: top; width: 30%">
<p class="separator"> </p>
{{ reception.doctor.doctor_name }}
</td>
</tr>
{% endfor %}
</tbody>
</table>

Categories