我想向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的指南,但是我找不到其他第三方软件包的使用方法。
我的问题是:
我不知道将这个重写的类放在哪里(在我的项目树中。)>
我不知道如何告诉Django它已被覆盖(settings.py?)。
谢谢。
我想向Django通知视图添加功能。我想做到这一点的最佳方法是重写类,添加我的自定义逻辑,然后将类传递给super:from notifications import ...
这就是我最终这样做的方式: