Open Quasarman opened 2 years ago
Thanks Johannes! Yes there is a way for you to make an easily accessible stream that is based off a query that can do queryset.distinct()
and fetch the results in a view/template. You just need to define your own ActionManager
if you have not done so and implement your shortcuts using the @stream
decorator. Please see this section on creating custom streams
https://django-activity-stream.readthedocs.io/en/latest/streams.html#writing-custom-streams
You would probably want to do something along the lines of obj.actor_actions.values('comment').distinct()
or something like that. Let me know if you get stuck
What is the cast error that you are seeing? Are the primary keys of the models you are filtering of different type?
Hello,
first of all everything is working like a charm! I was just wondering if and how i can only display action objects that are distinct. I dont want to i.e., show duplicate comments if they have for example a different actor and target but the user is following both. I added a GenericRelation on the action object I want to filter distinct but I get a cast error. I will provide more info once I debugged further, just wanted to ask if this is even possible so I dont waste no more time on this issue.
Br, Johannes