Skip to content

Commit

Permalink
Completed all additions of units to relevant areas sans the 'record a…
Browse files Browse the repository at this point in the history
…dministration' form (see #72) while en route to #71.
  • Loading branch information
dgets committed Jan 15, 2019
1 parent c7a90ad commit 3b20d9d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion recadm/templates/recadm/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h3>Administration Details</h3>
Dosage:
</td>
<td>
{{ dosage }}
{{ dosage }}{{ units }}
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion recadm/templates/recadm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3 class="mission">{{ header_info.mission }}</h3>
<ul>
{% for admin_details in mydata %}
<li><a href="{% url 'recadm:detail' admin_details.id %}">
{{ admin_details.ts }}: {{ admin_details.dosage }}mg
{{ admin_details.ts }}: {{ admin_details.dosage }}{{ admin_details.units }}
{{ admin_details.substance_name }}
</a></li>
{% endfor %}
Expand Down
3 changes: 3 additions & 0 deletions recadm/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ def index(request):
"""

recent_administrations = Usage.objects.filter(user=request.user)

mydata = [] # this can no doubt be handled better via the db

for administration in recent_administrations:
mydata.append({'ts': administration.timestamp,
'id': administration.id,
'dosage': administration.dosage,
'units': administration.sub.units,
'substance_name': administration.sub,})

context = {'mydata': mydata, 'user': request.user,}
Expand Down Expand Up @@ -133,6 +135,7 @@ def detail(request, topic_id):
context = {
'sub': admin_details.sub,
'dosage': admin_details.dosage,
'units': admin_details.sub.units,
'timestamp': admin_details.timestamp,
'notes': admin_details.notes,
}
Expand Down

0 comments on commit 3b20d9d

Please sign in to comment.