feat: add relationships from person to org

Resolves #77
See #78
This commit is contained in:
James Graham
2021-03-02 09:03:10 +00:00
parent 6d5188af72
commit 936a375992
11 changed files with 454 additions and 30 deletions

View File

@@ -19,6 +19,16 @@ class OrganisationListView(LoginRequiredMixin, ListView):
model = models.Organisation
template_name = 'people/organisation/list.html'
def get_context_data(self,
**kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
context = super().get_context_data(**kwargs)
context['existing_relationships'] = set(
self.request.user.person.organisation_relationship_targets.
values_list('pk', flat=True))
return context
class OrganisationDetailView(LoginRequiredMixin, DetailView):
"""View displaying details of a :class:`Organisation`."""