【问题标题】:Dexterity custom add forms trouble灵巧自定义添加表格麻烦
【发布时间】:2012-03-03 15:24:56
【问题描述】:

我正在尝试为自定义敏捷 AddForm 设置不同的架构接口,但当我访问添加表单时,它会呈现“默认”接口。

这是我的代码:

package.name.typename.py

class IMyType(form.Schema):

    """ interface for mytype schema
    """
    title = schema.TextLine(
            title=_(u"Name"),
        )

    description = schema.Text(
            title=_(u"little description"),
        )

class IMyTypeAdd(IMyType):
    """ para formulario de add 
    """
    title = schema.TextLine(
            title=_(u"Name for custom addform"),
        )


class AddForm(dexterity.AddForm):
    grok.name('package.name.mytype')
    grok.context('IMyTypeAdd') 

通过看到标题提示,我可以看到添加表单界面没有使用。 我的错误在哪里? 谢谢!

【问题讨论】:

    标签: python plone dexterity


    【解决方案1】:

    我认为问题在于 grok.context() 语句。添加表单的上下文不是类型,而是添加类型的文件夹。

    http://plone.org/products/dexterity/documentation/manual/developer-manual/advanced/forms

    马丁

    【讨论】:

      猜你喜欢
      • 2021-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-03
      • 2019-11-20
      • 2013-12-06
      • 2020-08-28
      • 1970-01-01
      相关资源
      最近更新 更多