本文整理汇总了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")