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

Denis Laxalde denis.laxalde at logilab.fr
Fri Dec 6 11:14:13 CET 2013

Rémi Cardona a écrit :
> Le 04/12/2013 16:50, Denis Laxalde a écrit :
>> Christophe de Vienne a écrit :
>>> I propose to add a new method to ResultSet, named one(), that would
>>> return exactly one entity from the resultset.
>>> If more than one row and one column, or no row at all is found, an
>>> exception would be raised.
>> Request's find_one_entity method does something like that, even though
>> you don't write RQL.
>> http://docs.cubicweb.org/devweb/request.html#cubicweb.req.RequestSessionBase.find_one_entity
> Speaking of find_one_entity() and find_entities(), they currently lack
> support for reverse relations. I started adding support for it a couple
> of weeks ago inside find_entities() but didn't follow through with a
> complete patch (that, and I ended up not needing it).
> Here's what I started, maybe someone will find it interesting and pick
> it up.

Maybe add a ticket, and push your patch (with a "wip" or so) to review 
so that it does not get lost.

More information about the Cubicweb mailing list