New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow fields to be omitted from list/detail form of resources #538
Conversation
Conflicts: tastypie/fields.py Pass use_in to the superclass. Conflicts: tastypie/fields.py Tests for related resources
I realized that this wasn't working for related fields. Fixed that in the last commit. |
@@ -65,6 +71,7 @@ def __init__(self, attribute=None, default=NOT_PROVIDED, null=False, blank=False | |||
self.readonly = readonly | |||
self.value = None | |||
self.unique = unique | |||
self.use_in = use_in if use_in in ['all', 'detail', 'list'] or callable(use_in) else 'all' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like this line to be broken down more. It's difficult to read as it stands. Perhaps start with the default, then with multiple if
statements to apply the options.
Other than that piece of feedback, |
Fixed in SHA: fc4140c |
@numan, I was playing and trying out the
|
was fixed in pull request #841 |
yup. The fix should be in a new release coming out soon |
This is a pull request based on the patch by @funkybob in #526. Most of the credit should go to him. Also addresses #18. Things I added to the patch:
use_in
can be a callback that is passed a bundle.use_in
defaults toall
if it is not a callable,list
, ordetail