Closed jayvdb closed 1 year ago
Or perhaps we should have a Many.query() -> Query
that creates a Query object pre-filtered to the Many
's objects, so then sorting can be specified before the query is executed.
I like that second idea. I don't see any reason that the output of Many.load
needs to always be sorted, but I agree that the ability to sort it would be valuable.
The
Iterator
returned byMany.load
doesn't have any default sorting.It would make sense to use the primary key as the default sorting for the database query, however there is also the aspect that
.load
also includes.new_values
, which would need to be manually sorted into the db values.Also I suspect there is a problem with
.load()
that it doesnt check/flush.removed_values
before reading from the database.