Make Q() return a boolean value based on it's length
|Reported by:||dcramer||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The goal would be to allow you to do a boolean check on a Q() object to see if it actually contains any statements.
x = Q()
<django.db.models.query.Q object at 0x275a410>
This would return False, and thus allow you to check the Q() instance to see if it actually has values.
Django falls back just fine with empty Q() objects, this is just a small nicety.