如何告诉Django Ive覆盖了第三方应用程序

问题描述 投票:0回答:1

我想向Django-Notifications视图添加功能。我想最好的方法是重写类,添加我的自定义逻辑,然后将类传递给super:

from notifications import AllNotificationsList

class CustomAllNotificationsList(AllNotificationsList):
    def get_queryset(self):
        # my custom logic
        return super(CustomAllNotificationsList, self).get_queryset(self)

我知道this替代Django Admin的指南,但是我找不到其他第三方软件包的使用方法。

我的问题是:

  1. 我不知道将这个重写的类放在哪里(在我的项目树中。)>

  2. 我不知道如何告诉Django它已被覆盖(settings.py?)。

  3. 谢谢。

我想向Django通知视图添加功能。我想做到这一点的最佳方法是重写类,添加我的自定义逻辑,然后将类传递给super:from notifications import ...

django django-apps django-notification django-packages
1个回答
0
投票

这就是我最终这样做的方式:

© www.soinside.com 2019 - 2024. All rights reserved.