-
posts
-
'self' ForeignKeys always result in a JOIN
I came across a little annoyance in Django today. I found that
ForeignKeys that reference ‘self’, i.e. they point to the same table,
always result in a join in a filter.
Take this normal foreign key reference.
class Customer(models.Models):
...
-
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...