This means in the shell you can just do User.query(samdb) without having to wrap it in list() all the time.
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
for message in self.result:
yield self._from_message(message)
+ def __repr__(self):
+ """Provide repr method that provides more useful output in the shell."""
+ return f"<Query {list(self)}>"
+
def _from_message(self, message):
"""Returns the model class to use to construct instances.