-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature of having with_user_activity=True parameter when using User Activity Feed (User Stream) url #468
Conversation
Add the method of using ``?with_user_activity=True`` in user activity feed to include user own actions.
I guess the change I've made, while works for Json activity feed breaks Atom activity feed. So perhaps I should change another function or create a Mixin for including |
I have updated the code. I added |
It seemed none of the solutions above fit. I finally created a mixin ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, the mixin class needed to be tested
actstream/feeds.py
Outdated
@@ -242,6 +242,11 @@ def get_object(self, request, content_type_id, object_id): | |||
def get_stream(self): | |||
return any_stream | |||
|
|||
class StreamKwargsMixin(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicit inheritance from the object is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah there is no need to do that. But I followed the pattern of other classes in feeds.py
like AbstractActivityStream
, ModelActivityMixin
, etc.
Also I will add tests for StreamKwargsMixin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking for unit test
I'm working on it. I hope I can provide it soon. |
- Add query_string param to `capture` in tests/base.py - Add test for json feed and json feed + with_user_activity=true (UserJSONActivityFeed inherits StreamKwargsMixin)
I've added the related tests to |
Unit tests added. Can u take alook? |
@@ -26,6 +26,14 @@ Shows user stream for currently logged in user. | |||
/activity/feed/atom/ | |||
/activity/feed/json/ | |||
|
|||
If you want to include the user own activity, the optional parameter ``with_user_activity`` can be passed to the user stream as a query string parameter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am willing to know if this is part of activity stream specification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meh
I liked to have a feature that I can get the user own activity by passing
with_user_activity=True
through query parameter like/activity/feed/json/with_user_activity=true
.So I added the
items
function toUserActivityMixin
. Take a look at the code and tell me your comments about that or this feature.