initcrash/django-denorm — pull request #30 by anentropic (2013-09-25 15:48:17+00:00)
Title: don't use attname in the ORM update kwargs, not recognised

I had a denormalised field like:

@denormalized(models.ForeignKey, to='Team', null=True, blank=True)
@depend_on_related('Team', foreign_key='member')
def team(self):
i, team = self._team_and_member_index()
return team.pk

When I tried to `./manage.py denorm_rebuild` (or do a `rebuildall()` in python console) I was getting the error:

FieldDoesNotExist: Member has no field named 'team_id'

I think it's wrong to try and use the `attname` in the update query... this fixes it for me and I'm pretty sure shouldn't break anything else.