本文整理汇总了Python中core.models.User.select方法的典型用法代码示例。如果您正苦于以下问题:Python User.select方法的具体用法?Python User.select怎么用?Python User.select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.models.User
的用法示例。
在下文中一共展示了User.select方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: system_users
# 需要导入模块: from core.models import User [as 别名]
# 或者: from core.models.User import select [as 别名]
def system_users():
user = auth.is_logged_in(request)
permission = auth.is_sys_admin(user)
return listing(request, None, User.select(),
'system_users', 'system_manage_users',
user=user)
示例2: get_users_with_permission
# 需要导入模块: from core.models import User [as 别名]
# 或者: from core.models.User import select [as 别名]
def get_users_with_permission(level):
permissions = Permission.select(Permission.user).where(
Permission.permission == level)
users_with_permissions = User.select().where(
User.id << permissions)
return users_with_permissions
示例3: author_context
# 需要导入模块: from core.models import User [as 别名]
# 或者: from core.models.User import select [as 别名]
def author_context(fileinfo, original_page, tag_context, date_counter):
if fileinfo is None:
author_context = [original_page.author]
else:
author_context = [fileinfo.author]
author_limiter = User.select().where(User.id == author_context)
tag_context_next = tag_context.select().where(Page.user << author_limiter)
return tag_context_next, date_counter
示例4: system_context
# 需要导入模块: from core.models import User [as 别名]
# 或者: from core.models.User import select [as 别名]
def system_context(user_to_edit=None, path='basic'):
try:
root_path = '/system/user/{}'.format(user_to_edit.id)
except AttributeError:
root_path = ''
return master_context(User.select(), path, root_path)