The CaseCollection constructor and the method CaseCollection.filter() have a new optional parameter called has. The filter() method generally returns a new CaseCollection instance; if has is specified, it is passed on to the constructor, which stores it in the member slot _has.
All searches on a DocumentCollection involve the _next_batch()/_next_batch_async() methods. These methods are overridden by CaseCollection.
_next_batch()/_next_batch_async() for CaseCollection checks if the member slot _has is set. If it is, we
Run a query to get all the values for fmu.case.uuid for the existing filters for the CaseCollection instance.
Create a new query that combines the value of _has with the set of values for fmu.case.uuid. Note: this new query applies to all object types, and not just case objects.
Retrieve all values for fmu.case.uuid for this new query.
Change the current filter for the CaseCollection instance to something like {"ids": {"values": <uuids>}}
Set the _hasmember attribute to None.
After checking/handling the _has attribute, _next_batch()/_next_batch_async() passes control to the parent class implementation.
Pre-review checklist
[ ] Read through all changes. No redundant print() statements, commented-out code, or other remnants from the development. ๐
[โ ] Make sure tests pass after every commit. โ
[โ ] New/refactored code is following same conventions as the rest of the code base. ๐งฌ
Issue
325
Short description
CaseCollection
constructor and the methodCaseCollection.filter()
have a new optional parameter calledhas
. Thefilter()
method generally returns a newCaseCollection
instance; ifhas
is specified, it is passed on to the constructor, which stores it in the member slot_has
.DocumentCollection
involve the_next_batch()
/_next_batch_async()
methods. These methods are overridden byCaseCollection
._next_batch()
/_next_batch_async()
forCaseCollection
checks if the member slot_has
is set. If it is, wefmu.case.uuid
for the existing filters for theCaseCollection
instance._has
with the set of values forfmu.case.uuid
. Note: this new query applies to all object types, and not justcase
objects.fmu.case.uuid
for this new query.CaseCollection
instance to something like{"ids": {"values": <uuids>}}
_has
member attribute toNone
._has
attribute,_next_batch()
/_next_batch_async()
passes control to the parent class implementation.Pre-review checklist
print()
statements, commented-out code, or other remnants from the development. ๐Pre-merge checklist