当前位置: 首页>>代码示例>>Python>>正文


Python ObjectList.bind_to_model方法代码示例

本文整理汇总了Python中wagtail.wagtailadmin.edit_handlers.ObjectList.bind_to_model方法的典型用法代码示例。如果您正苦于以下问题:Python ObjectList.bind_to_model方法的具体用法?Python ObjectList.bind_to_model怎么用?Python ObjectList.bind_to_model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wagtail.wagtailadmin.edit_handlers.ObjectList的用法示例。


在下文中一共展示了ObjectList.bind_to_model方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_edit_handler_class

# 需要导入模块: from wagtail.wagtailadmin.edit_handlers import ObjectList [as 别名]
# 或者: from wagtail.wagtailadmin.edit_handlers.ObjectList import bind_to_model [as 别名]
 def get_edit_handler_class(self):
     if hasattr(self.model, 'edit_handler'):
         edit_handler = self.model.edit_handler
     else:
         panels = extract_panel_definitions_from_model_class(self.model)
         edit_handler = ObjectList(panels)
     return edit_handler.bind_to_model(self.model)
开发者ID:potatolondon,项目名称:wagtail-gae,代码行数:9,代码来源:views.py

示例2: get_edit_handler_class

# 需要导入模块: from wagtail.wagtailadmin.edit_handlers import ObjectList [as 别名]
# 或者: from wagtail.wagtailadmin.edit_handlers.ObjectList import bind_to_model [as 别名]
 def get_edit_handler_class(self):
     if hasattr(self.model, 'edit_handler'):
         edit_handler = self.model.edit_handler
     else:
         fields_to_exclude = self.model_admin.get_form_fields_exclude(request=self.request)
         panels = extract_panel_definitions_from_model_class(self.model, exclude=fields_to_exclude)
         edit_handler = ObjectList(panels)
     return edit_handler.bind_to_model(self.model)
开发者ID:kapito,项目名称:wagtail,代码行数:10,代码来源:views.py

示例3: get_snippet_edit_handler

# 需要导入模块: from wagtail.wagtailadmin.edit_handlers import ObjectList [as 别名]
# 或者: from wagtail.wagtailadmin.edit_handlers.ObjectList import bind_to_model [as 别名]
def get_snippet_edit_handler(model):
    if model not in SNIPPET_EDIT_HANDLERS:
        if hasattr(model, 'edit_handler'):
            # use the edit handler specified on the page class
            edit_handler = model.edit_handler
        else:
            panels = extract_panel_definitions_from_model_class(model)
            edit_handler = ObjectList(panels)

        SNIPPET_EDIT_HANDLERS[model] = edit_handler.bind_to_model(model)

    return SNIPPET_EDIT_HANDLERS[model]
开发者ID:FannyFlores,项目名称:wagtail,代码行数:14,代码来源:snippets.py

示例4: edit_handler_class

# 需要导入模块: from wagtail.wagtailadmin.edit_handlers import ObjectList [as 别名]
# 或者: from wagtail.wagtailadmin.edit_handlers.ObjectList import bind_to_model [as 别名]
 def edit_handler_class(self, model):
     """A GenericModelChooserPanel class that works on
     PageChooserModel's 'page' field
     """
     object_list = ObjectList([GenericModelChooserPanel('page')])
     return object_list.bind_to_model(model)
开发者ID:kinaklub,项目名称:next.filmfest.by,代码行数:8,代码来源:test_edit_handlers.py


注:本文中的wagtail.wagtailadmin.edit_handlers.ObjectList.bind_to_model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。