Move contains_aggregate from ExpressionNode to F
|Reported by:||jorgecarleitao||Owned by:||jorgecarleitao|
|Component:||Database layer (models, ORM)||Version:||1.6|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
ExpressionNode.contains_aggregate is calling
self.name, which would raise an
if it would be called by an instance of type
One way is to move it to
F since it is the only subclass of
ExpressionNode with an attribute name (and thus the intended class to be used).
This is not part of the Public API, but cleans
There is also a call of the form
django/models/db/sql/query.py which could be simplified by this.
PR follows as comment.