code: def get_topic(self):
          
          if not hasattr(self, 'topic'):
              self.topic = get_object_or_404(
                  Topic.objects.select_related('forum').all(), pk=self.kwargs['pk'],
              )
          return self.topic
docs: Returns the topic to consider.