本文整理匯總了Python中wye.profiles.models.Profile.is_coordinator方法的典型用法代碼示例。如果您正苦於以下問題:Python Profile.is_coordinator方法的具體用法?Python Profile.is_coordinator怎麽用?Python Profile.is_coordinator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類wye.profiles.models.Profile
的用法示例。
在下文中一共展示了Profile.is_coordinator方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: workshop_details
# 需要導入模塊: from wye.profiles.models import Profile [as 別名]
# 或者: from wye.profiles.models.Profile import is_coordinator [as 別名]
def workshop_details(request, pk):
template_name = "workshops/workshop_detail.html"
workshop_obj = get_object_or_404(Workshop, id=pk)
show_contact_flag = False
user = request.user
if (
[u for u in workshop_obj.presenter.all() if user == u]
or [u for u in workshop_obj.requester.user.all() if user == u]
or user.is_superuser
or ((not user.is_anonymous) and Profile.is_coordinator(user))
):
show_contact_flag = True
context_dict = {"workshop": workshop_obj, "show_contact_flag": show_contact_flag}
return render(request, template_name, context_dict)
示例2: workshop_details
# 需要導入模塊: from wye.profiles.models import Profile [as 別名]
# 或者: from wye.profiles.models.Profile import is_coordinator [as 別名]
def workshop_details(request, pk):
template_name = 'workshops/workshop_detail.html'
workshop_obj = get_object_or_404(Workshop, id=pk)
show_contact_flag = False
display_edit_button = False
user = request.user
user_is_presenter = [u for u in workshop_obj.presenter.all() if user == u]
user_is_requester = [
u for u in workshop_obj.requester.user.all() if user == u]
if (user_is_presenter or user_is_requester or
user.is_superuser or ((not user.is_anonymous()) and Profile.is_coordinator(user))):
show_contact_flag = True
if (user_is_presenter):
display_edit_button = True
context_dict = {
'workshop': workshop_obj,
'show_contact_flag': show_contact_flag,
'display_edit_button': display_edit_button
}
return render(request, template_name, context_dict)