Khoding / khoBlog

Consider decorating method with @staticmethod PYL-R0201
Performance
Major
5 months ago3 years old
Method doesn't use the class instance and could be converted into a static method
 23    template_name = "portfolio/project_list.html"
 24    context_object_name = "projects"
 25
 26    def get_queryset(self): 27        """Get queryset"""
 28        return Project.objects.filter(deleted_at=None)
 29
Method doesn't use the class instance and could be converted into a static method
40    template_name = "polls/detail.html"
41    permission_required = "polls.view_question"
42
43    def get_queryset(self):44        """Excludes any questions that aren't published yet."""
45        return Question.objects.filter(pub_date__lte=timezone.now())
46
Method doesn't use the class instance and could be converted into a static method
18    context_object_name = "latest_question_list"
19    permission_required = "polls.view_question"
20
21    def get_queryset(self):22        """
23        Return the last five published questions (not including those set to be
24        published in the future).
Method doesn't use the class instance and could be converted into a static method
14        """Items"""
15        return self.model.objects.filter(withdrawn=False, deleted_at=None)
16
17    def lastmod(self, obj):18        """Lastmod"""
19        return obj.mod_date
Method doesn't use the class instance and could be converted into a static method
 84    template_name = "lyrics/song_list.html"
 85    context_object_name = "songs"
 86
 87    def get_queryset(self): 88        """Get queryset"""
 89        return Artist.objects.filter(deleted_at=None)
 90