AttributeError #79

Closed
skizzy opened this Issue Mar 16, 2012 · 1 comment

Projects

None yet

2 participants

@skizzy
skizzy commented Mar 16, 2012

Hello, when I tried visiting “127.0.0.1:8000/activity/” the page is always displaying “No actions yet” even when users comment on their status, follow each other. It won’t show any activity been done by users.
I tried creating my custom streams, but I’m getting error:

 AttributeError at /activity/actors/3/1/
 'GenericRelatedObjectManager' object has no attribute 'mystream'
 Request Method:    GET
 Request URL:   http://127.0.0.1:8000/activity/actors/3/1/
 Django Version:    1.3.1
 Exception Type:    AttributeError
 Exception Value:   'GenericRelatedObjectManager' object has no attribute 'mystream'
 Exception Location:    C:\Python27\Scripts\myweb\..\myweb\meekapp\views.py in <module>, line 33
 Python Executable: C:\Python27\python.exe
 Python Version:    2.7.2

In myapp/managers.py

from datetime import datetime
from django.contrib.contenttypes.models import ContentType
from actstream.managers import ActionManger, 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)

in views:

 from django.contrib.auth.models import User
from actstream.models import Action

actvity

 user_instance=User.objects.all()[0]
  user_instance.actor_actions.mystream ('commented','status','rate','profile')

What I’m I doing wrong?

@justquick
Owner

this issue prompted a lot of refactoring to how actstream deals with custom managers. check out the new docs and make sure you set ACTSTREAM_MANAGER = "myapp.managers.MyActionManager"

@justquick justquick closed this Jul 12, 2012
@justquick justquick referenced this issue Jul 12, 2012
Closed

AttributeError #78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment