How to get rid of the __actions__ entry in the CrudRestController's response?
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__', ]
精彩评论