def get_all_pending(self, state, dict_):
    if self.key in dict_:
        current = dict_[self.key]
if current is not None:
    ret = [(instance_state(current), current)]
else:
    ret = [(None, None)]
Overriding __cmp__, __eq__, and __hash__ for SQLAlchemy Declarative Base