def _activities_from_groups_followed_by_user_query(user_id, limit):
 import ckan.model as model
 follower_objects = model.UserFollowingGroup.followee_list(user_id)
 if (not follower_objects):
  return model.Session.query(model.Activity).filter('0=1')
 return _activities_union_all(*[_activities_limit(_group_activity_query(follower.object_id), limit) for follower in follower_objects])

def _activities_from_groups_followed_by_user_query ( user_id , limit ) : import ckan . model as model follower_objects = model . UserFollowingGroup . followee_list ( user_id ) if ( not follower_objects ) : return model . Session . query ( model . Activity ) . filter ( '0=1' ) return _activities_union_all ( * [ _activities_limit ( _group_activity_query ( follower . object_id ) , limit ) for follower in follower_objects ] )
return a query for all activities about groups the given user follows .