'self' ForeignKeys always result in a JOIN
I came across a little annoyance in Django today. I found that a ForeignKey
that reference self, i.e. points to the same table, always results in a join
in a filter.
Take this normal foreign key reference.
class Customer(models.Models):
user...
Field/column Queries in Django
One of the neat things making it’s way into Django 1.1 is F object
queries.
The F object is kind of like the Q object as it can be used it queries but it
represents a database field on the right hand side of an equality/inequality.
For the exampl...