_fix_query_dict modifies its argument in place. Ensure that the
argument passed in has a local name and will be passed into the
subsequent filter_by call.
query = Session.query_property()
@classmethod
- def find(cls, query_dict={}):
+ def find(cls, query_dict=None):
+ if query_dict is None:
+ query_dict = {}
+
_fix_query_dict(query_dict)
return cls.query.filter_by(**query_dict)
@classmethod
- def find_one(cls, query_dict={}):
+ def find_one(cls, query_dict=None):
+ if query_dict is None:
+ query_dict = {}
+
_fix_query_dict(query_dict)
return cls.query.filter_by(**query_dict).first()