models.py
class Lab(Model): acronym = CharField(max_length=10) class Message(Model): lab = ForeignKey(Lab)
You need to write your own view for that and then just override the get_queryset method:
get_queryset
class CustomListView(ListView): def get_queryset(self): return Message.objects.filter(lab__acronym=self.kwargs['lab'])
and use CustomListView in urls also.
CustomListView