def initial(self, request, *args, **kwargs):
        """
        Custom initial method:
            * ensure node exists and store it in an instance attribute
            * change queryset to return only comments of current node
        """
        super(NodeRelationViewMixin, self).initial(request, *args, **kwargs)
        self.node = get_object_or_404(Node, **{'slug': self.kwargs['slug']})
        self.queryset = self.model.objects.filter(node_id=self.node.id)
def initial ( self , request , * args , ** kwargs ) : super ( NodeRelationViewMixin , self ) . initial ( request , * args , ** kwargs ) self . node = get_object_or_404 ( Node , ** { 'slug' : self . kwargs [ 'slug' ] } ) self . queryset = self . model . objects . filter ( node_id = self . node . id )
Custom initial method:
            * ensure node exists and store it in an instance attribute
            * change queryset to return only comments of current node