本文整理汇总了Python中xadmin.layout.Field方法的典型用法代码示例。如果您正苦于以下问题:Python layout.Field方法的具体用法?Python layout.Field怎么用?Python layout.Field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xadmin.layout
的用法示例。
在下文中一共展示了layout.Field方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: replace_field_to_value
# 需要导入模块: from xadmin import layout [as 别名]
# 或者: from xadmin.layout import Field [as 别名]
def replace_field_to_value(layout, cb):
cls_str = str if six.PY3 else basestring
for i, lo in enumerate(layout.fields):
if isinstance(lo, Field) or issubclass(lo.__class__, Field):
layout.fields[i] = ShowField(
cb, *lo.fields, attrs=lo.attrs, wrapper_class=lo.wrapper_class)
elif isinstance(lo, cls_str):
layout.fields[i] = ShowField(cb, lo)
elif hasattr(lo, 'get_field_names'):
replace_field_to_value(lo, cb)
示例2: replace_field_to_value
# 需要导入模块: from xadmin import layout [as 别名]
# 或者: from xadmin.layout import Field [as 别名]
def replace_field_to_value(layout, av):
if layout:
cls_str = str if six.PY3 else basestring
for i, lo in enumerate(layout.fields):
if isinstance(lo, Field) or issubclass(lo.__class__, Field):
layout.fields[i] = ShowField(av, *lo.fields, **lo.attrs)
elif isinstance(lo, cls_str):
layout.fields[i] = ShowField(av, lo)
elif hasattr(lo, 'get_field_names'):
replace_field_to_value(lo, av)
示例3: replace_field_to_value
# 需要导入模块: from xadmin import layout [as 别名]
# 或者: from xadmin.layout import Field [as 别名]
def replace_field_to_value(layout, cb):
cls_str = str
for i, lo in enumerate(layout.fields):
if isinstance(lo, Field) or issubclass(lo.__class__, Field):
layout.fields[i] = ShowField(
cb, *lo.fields, attrs=lo.attrs, wrapper_class=lo.wrapper_class)
elif isinstance(lo, cls_str):
layout.fields[i] = ShowField(cb, lo)
elif hasattr(lo, 'get_field_names'):
replace_field_to_value(lo, cb)
示例4: replace_field_to_value
# 需要导入模块: from xadmin import layout [as 别名]
# 或者: from xadmin.layout import Field [as 别名]
def replace_field_to_value(layout, av):
if layout:
cls_str = str
for i, lo in enumerate(layout.fields):
if isinstance(lo, Field) or issubclass(lo.__class__, Field):
layout.fields[i] = ShowField(av, *lo.fields, **lo.attrs)
elif isinstance(lo, cls_str):
layout.fields[i] = ShowField(av, lo)
elif hasattr(lo, 'get_field_names'):
replace_field_to_value(lo, av)
示例5: replace_field_to_value
# 需要导入模块: from xadmin import layout [as 别名]
# 或者: from xadmin.layout import Field [as 别名]
def replace_field_to_value(layout, cb):
for i, lo in enumerate(layout.fields):
if isinstance(lo, Field) or issubclass(lo.__class__, Field):
layout.fields[i] = ShowField(
cb, *lo.fields, attrs=lo.attrs, wrapper_class=lo.wrapper_class)
elif isinstance(lo, basestring):
layout.fields[i] = ShowField(cb, lo)
elif hasattr(lo, 'get_field_names'):
replace_field_to_value(lo, cb)
示例6: replace_field_to_value
# 需要导入模块: from xadmin import layout [as 别名]
# 或者: from xadmin.layout import Field [as 别名]
def replace_field_to_value(layout, av):
if layout:
for i, lo in enumerate(layout.fields):
if isinstance(lo, Field) or issubclass(lo.__class__, Field):
layout.fields[i] = ShowField(av, *lo.fields, **lo.attrs)
elif isinstance(lo, basestring):
layout.fields[i] = ShowField(av, lo)
elif hasattr(lo, 'get_field_names'):
replace_field_to_value(lo, av)