Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade django add CWGC url #141

Merged
merged 1 commit into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cmp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from cmp.forms import editSoldierForm

from .models import SoldierDeath


from .models import SoldierDecoration

import folium
from django.views.generic import TemplateView
Expand Down Expand Up @@ -328,6 +329,10 @@ def soldier(request, soldier_id):
# get or return a 404
soldier = get_object_or_404(Soldier, pk=soldier_id)

# Soldier Decorations
soldierdecorations = SoldierDecoration.objects.filter(soldier=soldier)

# Soldier Deaths
cemetery_map = None
try:
soldierdeath = SoldierDeath.objects.get(soldier=soldier)
Expand Down
3 changes: 2 additions & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Django==4.2.7
Django==5.0.0
django-environ
django-debug-toolbar
django-extensions
django-htmx
django-storages
pytest-django
sentry-sdk
pytest-cov # used to generate coverage report
Expand Down
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ decorator==5.1.1
# via
# ipdb
# ipython
django==4.2.7
django==5.0
# via
# -r requirements.in
# crispy-bootstrap5
# django-crispy-forms
# django-debug-toolbar
# django-extensions
# django-htmx
# django-storages
django-crispy-forms==2.1
# via
# -r requirements.in
Expand All @@ -54,6 +55,8 @@ django-extensions==3.2.3
# via -r requirements.in
django-htmx==1.16.0
# via -r requirements.in
django-storages==1.14.2
# via -r requirements.in
executing==2.0.0
# via stack-data
flake8==6.1.0
Expand Down
4 changes: 3 additions & 1 deletion templates/cmp/soldier.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ <h4>Soldier Record</h4>
{% if soldier.soldierdecoration_set.all %}
<tr><td colspan="2"><h5>Decoration Record:</h5></td></tr>
{% for decoration in soldier.soldierdecoration_set.all %}
<tr><td>Decoration: </td><td>{{ decoration }} &#128240 (London Gazette: {{ decoration.gazette_issue }} Page: {{ decoration.gazette_page}} {{ decoration.gazette_date }}) </td></r>
<tr><td>Decoration: </td><td>{{ decoration }} <a href="{{ decoration.generate_gazette_url }}">(London Gazette: {{ decoration.gazette_issue }} Page: {{ decoration.gazette_page}} {{ decoration.gazette_date }}</a>) </td></r>


{% endfor %}
{% endif %}

Expand Down
Loading