Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't use attname in the ORM update kwargs, not recognised #30

Merged

Conversation

anentropic
Copy link
Contributor

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.

@anentropic
Copy link
Contributor Author

I'm on Django 1.5 in case that matters

@xaralis
Copy link

xaralis commented May 5, 2014

Can you merge this one? I'm having same issue and this really seems to fix it. On Django 1.6.2.

@xaralis
Copy link

xaralis commented May 5, 2014

Strange is, that this doesn't happen everytime though. On many instances it works and then suddenly, for one particular it fails.

@christian-schilling christian-schilling merged commit 67f1470 into django-denorm:master May 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants