I'm subclassing the CrudRestController to implement an REST interface. It works fine, but the response dict contains an __actions__ entry which contains some html code that I really don't want in my response.

According to the TableFiller class' docstring something like this should work:

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

But the page always throws an AttributeError: 'Process' object has no attribute '__actions__'

Any advice?

有帮助吗?

解决方案

Despite the inline docs, the correct way seems to be:

class table_filler_type(TableFiller):
    __model__ = Process
    __omit_fields__ = ['__actions__', ]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top