def _activities_from_user_query(user_id):
 import ckan.model as model
 q = model.Session.query(model.Activity)
 q = q.filter((model.Activity.user_id == user_id))
 return q

def _activities_from_user_query ( user_id ) : import ckan . model as model q = model . Session . query ( model . Activity ) q = q . filter ( ( model . Activity . user_id == user_id ) ) return q
return an sqlalchemy query for all activities from user_id .