toastdriven/django-tastypie — pull request #998 by bendemboski (2013-08-06 19:28:01+00:00)
Title: Expose for_list flag to use_in callable

When use_in is a string, it is used to determine whether the field should be present when dehydrating for a list, for details, or for either. When it is a callable, however, the callable method previously had no way of knowing if it was dehydrating for a list or detail, so, for example, there was no good way of implementing a field that should be present only under certain conditions *and* only in a detail view.

This addresses this issue in a backwards-compatible way by passing the for_list flag as the second argument to the use_in callable if the callable is expecting a second argument, or omitting it if it is not.