0

我将 CrudRestController 子类化以实现 REST 接口。它工作正常,但响应字典包含一个__actions__条目,其中包含一些我在响应中真的不想要的 html 代码。

根据 TableFiller 类的文档字符串,这样的东西应该可以工作:

class ProcessController(CrudRestController):
    model = Process
    #...
    class table_filler_type(TableFiller):
        __model__ = Process
        __actions__ = False

但是页面总是抛出一个AttributeError: 'Process' object has no attribute '__actions__'

有什么建议吗?

4

1 回答 1

1

尽管有内联文档,但正确的方法似乎是:

class table_filler_type(TableFiller):
    __model__ = Process
    __omit_fields__ = ['__actions__', ]
于 2011-03-20T18:44:02.083 回答