You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Field 'actor' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation.
#525
def ready(self):
from actstream import registry
registry.register(apps.get_model(settings.AUTH_USER_MODEL))
django shell
In [9]: action.send(u,verb='started testing activity')
Out[9]: [(<function actstream.actions.action_handler(verb, **kwargs)>,
<Action: system.admin started testing activity 0 minutes ago>)]
...
In [15]: user_stream(u, with_user_activity=True)
Out [15]: <GFKQuerySet [<Action: system.admin started testing activity 2 minutes ago>]>
...
In [47]: Action.objects.get(actor=u)
ERROR...
FieldError: Field 'actor' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation.
The text was updated successfully, but these errors were encountered:
@auvipy i just want to make sure i've done full settings of django-activity-stream for my project, i copied and run a query from django-activity-stream documentation, section Custom Action Data, it showed the above error.
action = Action.objects.get(verb='answered', actor=galahad, target=bridgekeeper)
action.data['favorite_color']
'Blue. No, yel... AAAAAAA'
action.data['quest'] = 'To seek the Holy Grail'
action.save()
action.data
{'favorite_color': 'Blue. No, Green - AAAAAAA', 'quest': 'To seek the Holy Grail'}
@justquick yes i did, i can do action.send and query user_stream without issues, i tried to use registry.check to check it.
Any update on this? I'm trying to follow the example. I've verified that setup_generic_relations gets called on the User model, but actions = Action.objects.filter(actor=user) does not work.
Field 'actor' does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation.
Hi everyone, i'm playing with django-activity-stream docs Custom Action Data https://django-activity-stream.readthedocs.io/en/latest/data.html and i found an issue, i seem can't query Action like the docs describe.
env
setup
django shell
The text was updated successfully, but these errors were encountered: