How to get rid of the __actions__ entry in the CrudRestController's response?

StackOverflow https://stackoverflow.com/questions/5369606

  •  27-10-2019
  •  | 
  •  

문제

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