So, in conclusion, Lachlan, you would want to do something like:def get_context_data(self,**kwargs):context['job_list'] = Vacancy.complete.filter(person_id=self.kwargs[self.pk_url_kwarg])
#Call the base implementation first to get a context
context = super(PersonDetailView, self).get_context_data(**kwargs)
#Add in a querysets
context['certificate_list'] = Certificate.objects.filter(person_id=self.kwargs[self.pk_url_kwarg])
context['claim_list'] = Compensation.objects.filter(person_id=self.kwargs[self.pk_url_kwarg])
return contextI have not tested this, but it gives you the idea. You'll want to filter the Vacancy, Certificate and Compensation objects by the person's ID.
Great - thanks!
L,
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment