本文整理汇总了Python中gasistafelice.des.models.DES类的典型用法代码示例。如果您正苦于以下问题:Python DES类的具体用法?Python DES怎么用?Python DES使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DES类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: can_create
def can_create(cls, user, context):
# Who can create a new unit of measure for products ?
# * DES administrators
try:
allowed_users = DES.admins_all()
return user in allowed_users
except KeyError:
raise WrongPermissionCheck('CREATE', cls, context)
示例2: can_delete
def can_delete(self, user, context):
# Who can delete an existing unit of measure for products ?
# * DES administrators
allowed_users = DES.admins_all()
return user in allowed_users
示例3: can_edit
def can_edit(self, user, context):
# Who can edit details of an existing unit of measure for products ?
# * DES administrators
allowed_users = DES.admins_all()
return user in allowed_users