You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def custom_button(context):
admin = context.get('cl').model_admin
data = {}
actions = admin.get_actions(context.request)
# if hasattr(admin, 'actions'):
# actions = admin.actions
# 输出自定义按钮的属性
for name in actions:
values = {}
fun = actions.get(name)[0]
for key, v in fun.dict.items():
if key != 'len':
values[key] = v
data[name] = values
临时我增加了一个判断来解决
# 输出自定义按钮的属性
if not actions : return '{}'
bug描述
简单的描述下遇到的bug:
当使用权限设置不显示ACTION按钮时, 会出错
def custom_button(context):
admin = context.get('cl').model_admin
data = {}
actions = admin.get_actions(context.request)
# if hasattr(admin, 'actions'):
# actions = admin.actions
# 输出自定义按钮的属性
for name in actions:
values = {}
fun = actions.get(name)[0]
for key, v in fun.dict.items():
if key != 'len':
values[key] = v
data[name] = values
临时我增加了一个判断来解决
# 输出自定义按钮的属性
if not actions : return '{}'
环境
1.操作系统:
2.python版本:3.6
3.django版本:2.1
4.simpleui版本:2
The text was updated successfully, but these errors were encountered: