I want to find all entries in a database where two specific fields are
equal:
mytable.objects.filter(column_a='column_b')
But this gives me no results at all. I now managed to get it done with
a .extra(), but I was wondering if this is the only possible solution.
All examples in the documentation work with static values for
comparison and there are no further details about the right hand side
of the query.
Thanks for reading!
Thomas.
P.S.:
Here's the query which get's the work done:
mytable.objects.extra(where=['column_a=column_b'])
At present, the answer is unfortunately 'you can't do this' (unless
you use a hack like the one you mentioned).
I've had a few ideas on how to fix this; however, fixing this area of
code would require changes to an area that is currently undergoing a
major refactor. Once the query engine changes are complete, I have a
number of issues to address - this is one of them.
Yours,
Russ Magee %-)
Thanks for the info! Saves me from trying around more.
Yours,
Thomas
On Aug 2, 1:25 pm, "Russell Keith-Magee" <freakboy3...@gmail.com>
wrote: