Skip to content

Commit

Permalink
Merge pull request #1621 from dchiller/i1594-display-chant-project
Browse files Browse the repository at this point in the history
Display chant.project on Chant Detail page where it exists
  • Loading branch information
dchiller authored Aug 30, 2024
2 parents 8dd5e3c + 8691030 commit c3f78ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django/cantusdb_project/main_app/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ class Project(BaseModel):
name = models.CharField(max_length=63)

def __str__(self):
return f"{self.name} ({self.id})"
return f"{self.name}"
7 changes: 7 additions & 0 deletions django/cantusdb_project/main_app/templates/chant_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ <h3>{{ chant.incipit }}</h3>
<dd>{{ chant.c_sequence }}</dd>
</div>
{% endif %}

{% if chant.project %}
<div class="form-group col-6">
<dt>Project</dt>
<dd>{{ chant.project }}</dd>
</div>
{% endif %}
</div>

<div class="form-row">
Expand Down
2 changes: 1 addition & 1 deletion django/cantusdb_project/main_app/views/chant.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class ChantDetailView(DetailView):
def get_queryset(self) -> QuerySet:
qs = super().get_queryset()
return qs.select_related(
"source__holding_institution", "service", "genre", "feast"
"source__holding_institution", "service", "genre", "feast", "project"
)

def get_context_data(self, **kwargs):
Expand Down

0 comments on commit c3f78ae

Please sign in to comment.