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


Python FormFieldsets.required方法代码示例

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


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

示例1: set

# 需要导入模块: from plone.fieldsets.fieldsets import FormFieldsets [as 别名]
# 或者: from plone.fieldsets.fieldsets.FormFieldsets import required [as 别名]
        assignment.portal_type = portal_type
        assignment.assigned_categories = set(selected_categories(portal_type))

        return assignment

def selected_categories(portal_type):
    assignments = getUtility(IRatingCategoryAssignment)
    return (t for t in assignments.categories_for_type(portal_type))


typespolicies = FormFieldsets(IEditCategoryAssignment)
typespolicies.id = 'types_categories'
typespolicies.label = _(u'Rating Assignments')
typespolicies.description = _(u'Choose a portal type from the list and select '
u'one or more rating categories to appear on that type. ')
typespolicies.required = False

categories = FormFieldsets(ICategoryContainer)
categories.id = 'manage_categories'
categories.label = _(u'Manage Categories')
categories.description = _(u'Add, modify, or remove rating categories.  You '
u'may specify a title, description, conditions for viewing and setting '
u'ratings, a view to display the rating, and a relative order number.  '
u'Categories which are defined at a lower level (e.g., globally) may not be '
u'edited. You need to save your changes after adding or removing categories')

categories.required = False

class ContentRatingsControlPanel(ControlPanelForm):

    form_name = _(u"Category Assignments")
开发者ID:mikejmets,项目名称:plone.contentratings,代码行数:33,代码来源:controlpanel.py


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