bmuller/twistar — pull request #23 by flaviogrossi (2012-05-22 13:49:08+00:00)
Title: error when clearing jointable for dict-configured habtm relationships

hi brian,

when using the dict syntax to express a model's relationship like
```python
class Blogpost(DBObject):
HABTM = [dict(name='categories', join_table='posts_categories')]
```

an exception is raised on delete() calls:
getattr(): attribute name must be string

this is caused by the following code in the delete() method:
```python
ds = [getattr(self, relation).clear(transaction=self._transaction) for relation in self.HABTM]
```
since in this case relation is a dictionary.

attached there's a small test to expose the problem and my proposed solution.

bye,
flavio