def pull_merge(request): current = 'pull' title = u'%s / 需要我处理的合并请求' % (request.user.username) feedAction = FeedAction() feedAction.set_user_position(request.user.id, PositionKey.PULL) recently_timestamp_astime = feedAction.get_recently_timestamp_astime( request.user.id, AttrKey.RECENTLY_TIME_PULL) pullRequests = RepoManager.list_pullRequest_by_mergeUserId(request.user.id) feedAction.set_recently_timestamp_now(request.user.id, AttrKey.RECENTLY_TIME_PULL) response_dictionary = { 'current': current, 'title': title, 'pullRequests': pullRequests, 'recently_timestamp_astime': recently_timestamp_astime } return render_to_response('user/pull_merge.html', response_dictionary, context_instance=RequestContext(request))
def notif(request): current = 'notif' title = u'%s / 我的通知' % (request.user.username) feedAction = FeedAction() feedAction.set_user_position(request.user.id, PositionKey.NOTIF) recently_timestamp_astime = feedAction.get_recently_timestamp_astime( request.user.id, AttrKey.RECENTLY_TIME_NOTIF) notifMessages = FeedManager.list_notifmessage_by_userId( request.user.id, 0, 500) if request.userprofile.unread_message != 0: request.userprofile.unread_message = 0 request.userprofile.save() feedAction.set_recently_timestamp_now(request.user.id, AttrKey.RECENTLY_TIME_NOTIF) response_dictionary = { 'current': current, 'title': title, 'notifMessages': notifMessages, 'recently_timestamp_astime': recently_timestamp_astime } return render_to_response('user/notif.html', response_dictionary, context_instance=RequestContext(request))