【发布时间】:2020-10-01 00:14:09
【问题描述】:
我想为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 django-apps django-notification django-packages