Like my above solution, if most of the time there is going to be ```value``` in ```attributes``` then do:

```
try:
    return self.attributes["value"]
except KeyError:
    return self.attributes.get("attachment")
```

You use get in the except so that it will return ```None```.