On Fri, Aug 13, 2010 at 10:59 AM, Free Ekanayaka
<[email protected]> wrote:
> Hi,
>
> |--==> On Fri, 13 Aug 2010 10:39:56 +1200, Robert Collins 
> <[email protected]> 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())

IFF that *never executes SQL*.

(Remember the context here: we want to make things that look cheap
(properties) be cheap.

-Rob

_______________________________________________
Mailing list: https://launchpad.net/~launchpad-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to