plone.app.registry.browser.controlpanel によって生成されたアドオン構成ページ/フォームがあります
これらのドキュメントの使用:
http://plone.org/documentation/kb/how-to-create-a-plone-control-panel-with-plone.app.registry
https://pypi.python.org/pypi/plone .app.registry#control-panel-widget-settings
このフォームには、整数フィールドがあります。
from zope import schema
from plone.app.registry.browser import controlpanel
class MyAddonSettings(Interface):
partnerId = schema.Int(title=u"Partner Id",
description=u"enter your Partner ID",
required=True,
default=54321)
class SettingsEditForm(controlpanel.RegistryEditForm):
schema = MyAddonSettings
label = u"My settings"
description = u""""""
def updateFields(self):
super(SettingsEditForm, self).updateFields()
def updateWidgets(self):
super(SettingsEditForm, self).updateWidgets()
class SettingsControlPanel(controlpanel.ControlPanelFormWrapper):
form = SettingsEditForm
フォームがレンダリングされると、整数フィールドに「54,321」が自動入力されます。コンマは必要ありません。
「やらないで!」の指定方法