Skip to content

Commit

Permalink
Turns out syntax is important too.
Browse files Browse the repository at this point in the history
  • Loading branch information
toastdriven committed Sep 7, 2011
1 parent 1d0532a commit 803270e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/fields.rst
Expand Up @@ -258,7 +258,7 @@ This field also has special behavior when dealing with ``attribute`` in that
it can take a callable. For instance, if you need to filter the reverse
relation, you can do something like::

subjects = fields.ToManyField(SubjectResource, attribute=lambda bundle: Subject.objects.filter(notes=bundle.obj, name__startswith='Personal')
subjects = fields.ToManyField(SubjectResource, attribute=lambda bundle: Subject.objects.filter(notes=bundle.obj, name__startswith='Personal'))

Note that the ``hydrate`` portions of this field are quite different than
any other field. ``hydrate_m2m`` actually handles the data and relations.
Expand Down

0 comments on commit 803270e

Please sign in to comment.