예제 #1
0
 def activities(self, request):
     start = request.get_form_var('start', '0')
     limit = request.get_form_var('count', '20')
     if start.isdigit() and limit.isdigit():
         start = int(start)
         limit = int(limit)
     else:
         start = 0
         limit = 20
     activities = get_user_feed(self.user.username).get_actions(
         start, limit)
     return [format_timeline(activity) for activity in activities]
예제 #2
0
파일: __init__.py 프로젝트: 000fan000/code
def yours(request):
    user = request.user
    actions = (get_user_feed(user.username)
               .get_actions(stop=PAGE_ACTIONS_COUNT - 1))

    your_projects = CodeDoubanProject.get_projects(
        owner=user.username, sortby="lru")
    watched_projects = CodeDoubanProject.get_watched_others_projects_by_user(
        user=user.username, sortby='lru')

    badge_items = user.get_badge_items()
    return st('my_actions.html', **locals())
예제 #3
0
def yours(request):
    user = request.user
    actions = (get_user_feed(
        user.username).get_actions(stop=PAGE_ACTIONS_COUNT - 1))

    your_projects = CodeDoubanProject.get_projects(owner=user.username,
                                                   sortby="lru")
    watched_projects = CodeDoubanProject.get_watched_others_projects_by_user(
        user=user.username, sortby='lru')

    badge_items = user.get_badge_items()
    return st('my_actions.html', **locals())
예제 #4
0
파일: people.py 프로젝트: leeccong/code
 def _q_index(self, request):
     name = self.name
     your_projects = CodeDoubanProject.get_projects(owner=name, sortby="lru")
     actions = get_user_feed(name).get_actions(0, 20)
     user = User(name)
     teams = Team.get_by_user_id(user.name)
     badge_items = user.get_badge_items()
     followers_count = user.followers_count
     following_count = user.following_count
     if user and user.username == name and user.get_new_badges():
         user.clear_new_badges()
     return st("people.html", **locals())
예제 #5
0
파일: users.py 프로젝트: 000fan000/code
 def activities(self, request):
     start = request.get_form_var('start', '0')
     limit = request.get_form_var('count', '20')
     if start.isdigit() and limit.isdigit():
         start = int(start)
         limit = int(limit)
     else:
         start = 0
         limit = 20
     activities = get_user_feed(self.user.username).get_actions(
         start, limit)
     return [format_timeline(activity) for activity in activities]
예제 #6
0
파일: people.py 프로젝트: jackfrued/code-1
 def _q_index(self, request):
     name = self.name
     your_projects = CodeDoubanProject.get_projects(owner=name,
                                                    sortby='lru')
     actions = get_user_feed(name).get_actions(0, 20)
     user = User(name)
     teams = Team.get_by_user_id(user.name)
     badge_items = user.get_badge_items()
     followers_count = user.followers_count
     following_count = user.following_count
     if user and user.username == name and user.get_new_badges():
         user.clear_new_badges()
     return st('people.html', **locals())
예제 #7
0
 def test_userinbox(self):
     actor = 'testuser1'
     all_feed = [
         get_user_inbox(actor),
         get_user_feed(actor),
         get_public_feed(),
     ]
     data = dict(type='pull_request',
                 owner='testuser2',
                 url='',
                 title='pr title',
                 description='pr desc',
                 date=datetime.now(),
                 from_proj='10',
                 to_proj='1',
                 uid='pullrequest-1-1-unmerge')
     for feed in all_feed:
         feed.add_action(data)
         actions = feed.get_actions()
         assert len(actions) == 1