Unverified Commit 1f97a518 authored by mvdbeek's avatar mvdbeek
Browse files

Use ``populated_optimized`` when serializing collection

The slow collection in question has 8000+ paired elements, where each
element would need to be lazy-loaded before this change.
parent 4225e4b0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -6895,6 +6895,9 @@ class DatasetCollection(Base, Dictifiable, UsesAnnotations, Serializable):
    def populated(self):
        top_level_populated = self.populated_state == DatasetCollection.populated_states.OK
        if top_level_populated and self.has_subcollections:
            if self.id:
                return self.populated_optimized
            else:
                return all(e.child_collection and e.child_collection.populated for e in self.elements)
        return top_level_populated