当前位置: 首页>>代码示例>>Python>>正文


Python Permissions.can_see_follow_up方法代码示例

本文整理汇总了Python中mig_main.utility.Permissions.can_see_follow_up方法的典型用法代码示例。如果您正苦于以下问题:Python Permissions.can_see_follow_up方法的具体用法?Python Permissions.can_see_follow_up怎么用?Python Permissions.can_see_follow_up使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mig_main.utility.Permissions的用法示例。


在下文中一共展示了Permissions.can_see_follow_up方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_permissions

# 需要导入模块: from mig_main.utility import Permissions [as 别名]
# 或者: from mig_main.utility.Permissions import can_see_follow_up [as 别名]
def get_permissions(user):
    permission_dict = get_member_permissions(user)
    permission_dict.update({
        'can_edit_resources':Permissions.can_manage_electee_progress(user),
        'can_edit_surveys':Permissions.can_manage_electee_progress(user),
        'can_complete_surveys':Permissions.can_complete_electee_survey(user),
        'can_submit_background_form':can_submit_background_form(user),
        'can_submit_interview_followups':user_is_member(user) and user.userprofile.memberprofile.status.name=='Active',
        'can_view_interview_pairings':Permissions.can_view_interview_pairings(user),
        'can_view_followups':Permissions.can_see_follow_up(user),
        })
    return permission_dict
开发者ID:dadrian,项目名称:mig-website,代码行数:14,代码来源:views.py

示例2: view_interview_follow_up

# 需要导入模块: from mig_main.utility import Permissions [as 别名]
# 或者: from mig_main.utility.Permissions import can_see_follow_up [as 别名]
def view_interview_follow_up(request,follow_up_id):
    follow_up = get_object_or_404(ElecteeInterviewFollowup,id=follow_up_id)
    if not Permissions.can_see_follow_up(request.user):
        request.session['error_message']='You are not authorized to view this followup'
        return get_previous_page(request,alternate='electees:view_electee_groups')
    template = loader.get_template('electees/interview_followup.html')
    
    context_dict = {
        'follow_up':follow_up,
        'base':'electees/base_electees.html',
        }
    context_dict.update(get_common_context(request))
    context_dict.update(get_permissions(request.user))
    context = RequestContext(request, context_dict)
    return HttpResponse(template.render(context))
开发者ID:pritpaul,项目名称:mig-website,代码行数:17,代码来源:views.py

示例3: view_interview_pairings

# 需要导入模块: from mig_main.utility import Permissions [as 别名]
# 或者: from mig_main.utility.Permissions import can_see_follow_up [as 别名]
def view_interview_pairings(request):
    if not Permissions.can_view_interview_pairings(request.user):
        request.session['error_message']='You are not authorized to view interview state'
        return get_previous_page(request,alternate='member_resources:index')
        
    interview_shifts = InterviewShift.objects.filter(term=AcademicTerm.get_current_term()).order_by('interviewer_shift__start_time')
    template = loader.get_template('electees/view_interviews.html')
    context_dict ={
        'interviews':interview_shifts,
        'subnav':'misc_reqs',
        'base':'member_resources/base_member_resources.html',
        'can_view_follow_ups':Permissions.can_see_follow_up(request.user),
        }
    context_dict.update(get_permissions(request.user))
    context_dict.update(get_common_context(request))
    context = RequestContext(request,context_dict )
    return HttpResponse(template.render(context))
开发者ID:pritpaul,项目名称:mig-website,代码行数:19,代码来源:views.py

示例4: view_interview_follow_up_table

# 需要导入模块: from mig_main.utility import Permissions [as 别名]
# 或者: from mig_main.utility.Permissions import can_see_follow_up [as 别名]
def view_interview_follow_up_table(request):
    if not Permissions.can_see_follow_up(request.user):
        request.session['error_message']='You are not authorized to view followups'
        return get_previous_page(request,alternate='electees:view_electee_groups')
    electees = MemberProfile.get_electees()
    electee_data = []
    num_followups=0
    for electee in electees:
        follow_ups = ElecteeInterviewFollowup.objects.filter(interview__interviewee_shift__attendees=electee)
        num_followups=follow_ups.count() if follow_ups.count()>num_followups else num_followups
        electee_data.append({'electee':electee,'followups':follow_ups})
    template = loader.get_template('electees/interview_followup_table.html')
    interviewer_headers = ['Interviewer %d'%count for count in range(1,num_followups+1)]
    context_dict = {
        'interviewer_headers':interviewer_headers,
        'electees':electee_data,
        'base':'electees/base_electees.html',
        }
    context_dict.update(get_common_context(request))
    context_dict.update(get_permissions(request.user))
    context = RequestContext(request, context_dict)
    return HttpResponse(template.render(context))    
开发者ID:pritpaul,项目名称:mig-website,代码行数:24,代码来源:views.py

示例5: view_interview_follow_up_table

# 需要导入模块: from mig_main.utility import Permissions [as 别名]
# 或者: from mig_main.utility.Permissions import can_see_follow_up [as 别名]
def view_interview_follow_up_table(request):
    if not Permissions.can_see_follow_up(request.user):
        request.session['error_message']='You are not authorized to view followups'
        return get_previous_page(request,alternate='electees:view_electee_groups')
    electees = MemberProfile.get_electees()
    green_electees=[]
    yellow_electees=[]
    red_electees=[]
    blank_electees=[]
    num_followups=0
    for electee in electees:
        follow_ups = ElecteeInterviewFollowup.objects.filter(interview__interviewee_shift__attendees=electee).exclude(recommendation='X')
        num_followups=follow_ups.count() if follow_ups.count()>num_followups else num_followups
        num_red = follow_ups.filter(recommendation='N').count()
        num_yellow = follow_ups.filter(recommendation='M').count()
        if num_red:
            red_electees.append({'electee':electee,'followups':follow_ups})
        elif num_yellow:
            yellow_electees.append({'electee':electee,'followups':follow_ups})
        elif follow_ups.count():
            green_electees.append({'electee':electee,'followups':follow_ups})
        else:
            blank_electees.append({'electee':electee,'followups':follow_ups})
    template = loader.get_template('electees/interview_followup_table.html')
    interviewer_headers = ['Interviewer %d'%count for count in range(1,num_followups+1)]
    context_dict = {
        'interviewer_headers':interviewer_headers,
        'green_electees':green_electees,
        'yellow_electees':yellow_electees,
        'red_electees':red_electees,
        'blank_electees':blank_electees,
        'base':'electees/base_electees.html',
        }
    context_dict.update(get_common_context(request))
    context_dict.update(get_permissions(request.user))
    return HttpResponse(template.render(context_dict, request))
开发者ID:tbpmig,项目名称:mig-website,代码行数:38,代码来源:views.py


注:本文中的mig_main.utility.Permissions.can_see_follow_up方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。