When attempting to use a callable as the atribute for a ToManyField a TypeError is thrown.
This exception stems from the fact that https://github.com/toastdriven/django-tastypie/blob/master/tastypie/resources.py#L2062 assumes that the attribute will always be a string.
Is that the root of your traceback? I assume this is crate.io; can you point out the resource and the call?
I have a model with many-to-many relationship through another model. In order to get this relationship's data on GET I had to use 'attribute':
assignee = fields.ManyToManyField(UserResource, full=True, null=True, attribute=related_users_fun)
related_users_fun is a function
But now when I try to POST I get the exception saying 'getattr(): attribute name must be string'
Approved patches for fixing callable attributes on ToOneField and ToM…
…anyField. Thanks Donald Stufft and Valdimir Volodin for the fixes, and pennersr and sgarcez, for reports.