Skip to content

Conversation

@bikeshedder
Copy link
Contributor

Atomic updates with F do not work when the field uses a different db_column.

For now I have only prepared a test, which shows the wrong behavior.

@jonashaag
Copy link
Contributor

Looks good to me. Could you also come up with a fix?

Update spec generation is handled in compiler.py:SQLUpdateCompiler.update (around lines 420 - 450).

The problem is that in line 444, lhs.name is used instead of field.column. It's save to just replace it provided that the code along the lines 441-443 is never executed (which needs to be confirmed for instance by using a coverage tool -- runtests.py has an option to do that). I'm not sure why 441-443 exist in the first place, the code is sort of just c&p-ed from Django's SQL backend.

@jonashaag jonashaag merged commit 468262a into django-nonrel:master Nov 17, 2011
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.

2 participants