SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 2a8f18f6 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Update qs

parent 2e510bbd
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,8 @@ from django.urls import reverse ...@@ -3,6 +3,8 @@ from django.urls import reverse
from django_countries.fields import CountryField from django_countries.fields import CountryField
from scipost.models import Contributor
from .constants import INSTITUTION_TYPES, TYPE_UNIVERSITY from .constants import INSTITUTION_TYPES, TYPE_UNIVERSITY
from .managers import AffiliationQuerySet from .managers import AffiliationQuerySet
...@@ -26,6 +28,9 @@ class Institution(models.Model): ...@@ -26,6 +28,9 @@ class Institution(models.Model):
def get_absolute_url(self): def get_absolute_url(self):
return reverse('affiliations:institution_details', args=(self.id,)) return reverse('affiliations:institution_details', args=(self.id,))
def contributors(self):
return Contributor.objects.filter(institution=self)
class Affiliation(models.Model): class Affiliation(models.Model):
""" """
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<br> <br>
<h3>Contributors of {{ institution }}</h3> <h3>Contributors of {{ institution }}</h3>
<ul> <ul>
{% for contributor in institution.contributors.all %} {% for contributor in institution.contributors %}
<li>{{ contributor }}</li> <li>{{ contributor }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment