我想向Django-Notifications视图添加功能。我想最好的方法是重写类,添加我的自定义逻辑,然后将类传递给 super:
from notifications import AllNotificationsList
class CustomAllNotificationsList(AllNotificationsList):
def get_queryset(self):
# my custom logic
return super(CustomAllNotificationsList, self).get_queryset(self)
我知道这个覆盖 Django Admin 的指南,但我找不到如何为其他第三方包执行此操作。
我的问题是:
我不知道把这个被覆盖的类放在哪里(在我的项目树中)。
我不知道如何告诉 Django 它已被覆盖(settings.py?)。
谢谢你。