launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #04255
Re: What about non-DB performance?
Hi,
|--==> On Fri, 13 Aug 2010 10:39:56 +1200, Robert Collins <robert.collins@xxxxxxxxxxxxx> said:
[...]
> Storm ReferenceSets don't (currently) permit constraints, so while we
> can write a collection for *all* signatures a person has made, we
> can't tell storm how to calculate the attribute for us. We could layer
> it:
> signatures = ReferenceSet(..)
> @property
> def is_ubuntu_coc_signer(self):
> return bool(signature for signature in self.signatures
> if signature.active and signature > lastcocdate)
Hum, I might be totally off here, but isn't this somehow addressed by
BoundReferenceSet.find?
Like:
@property
def is_ubuntu_coc_signer(self):
result = self.signatures.find(active=True, *your_other_constraints)
return bool(result.one())
Cheers,
Free
Follow ups
References