문제

I have an attribute I want to expose in my API. Calculating this attribute is costly, so I want to make this available only in the detail view (aka /api/foo/1/) and not list view(aka /api/foo/).

How can I do this with tastypie?

도움이 되었습니까?

해결책

You can do this with the "use_in" resource field attribute, which has the options of "all", "list" and "detail".

You can read about it more here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top