[Cubicweb] Proposal: new method ResultSet.one()

Christophe de Vienne cdevienne at gmail.com
Thu Dec 5 19:00:11 CET 2013


It does not enforce the unicity of the entity, which forces us to add an extra test.


Nicolas Chauvat <nicolas.chauvat at logilab.fr> a écrit :
>On Thu, Dec 05, 2013 at 04:07:46PM +0100, Christophe de Vienne wrote:
>> The difference is that next will not enforce that only one entity is
>returned by the query.
>> >>
>> >> entity = execute('SOME REQUEST').one()
>
>What about the following ?
>
>  entity = execute('Any X LIMIT 1 WHERE SOME QUERY').get_entity(0,0) 
>
>-- 
>Nicolas Chauvat
>
>logilab.fr - services en informatique scientifique et gestion de
>connaissances  
>_______________________________________________
>Cubicweb mailing list
>Cubicweb at lists.cubicweb.org
>http://lists.cubicweb.org/mailman/listinfo/cubicweb

-- 
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20131205/ce3ef47b/attachment-0127.html>


More information about the Cubicweb mailing list