twilio/flask-restful — pull request #309 by joshfriend (2014-10-11 17:10:03+00:00)
Title: Allow lambdas to be specified for field attributes

This would allow more advanced ways of extracting information from models during serialization.

An example:
```python
class Child:
name = 'foo'

class Parent:
name = 'bar'
children = [Child(), Child()]

parent_fields = {
'name': fields.String,
'first_child': fields.Integer(attribute=lambda x: x.children[0].name),
}
```

A Parent object would then serialize as:
```
{
"name": "bar",
"first_child": "foo"
}
```