我正在使用django-activity-stream
应用程序并尝试编写自定义流。
帐户/managers.py
from datetime import datetime
from django.contrib.contenttypes.models import ContentType
from actstream.managers import ActionManager, stream
class MyActionManager(ActionManager):
@stream
def mystream(self, obj, verb='posted', time=None):
if time is None:
time = datetime.now()
return obj.actor_actions.filter(verb = verb, timestamp__lte = time)
视图.py
from actstream.models import Action
current_user = get_object_or_404(User, username=username)
current_user.actor_actions.mystream('commented')
设置.py
ACTSTREAM_MANAGER = 'accounts.managers.MyActionManager'
错误消息 >'str' object has no attribute 'actor_actions'
和完整的回溯
多谢