tleach/mongothon — pull request #9 by tleach (2013-10-15 19:19:24+00:00)
Title: Removed a couple of ill-conceived features

1. Virtual fields

These were implemented to be definable on the schema. In hindsight that was the wrong place for them. If anywhere they belong on models. Moreover, on reflection the existing implementation was a little clunky. A future implementation will look to take advantage of `@property`-like decorators for registration.

2. Magic properties

We had overridden `__getattr__` to allow document fields to be accessible as object properties as well as dict keys. e.g. blog.title as well as `blog['title']` as natively. In hindsight this was also the wrong decision. By messing with `__getattr__` we were making it more complex to add genuine properties to the model in order to do stuff like track model state. It also meant we ran the risk of property-key name collision. Finally it confuses developers as it's not entirely clear what setting a property actually does. Sometimes, clarity trumps conciseness.