[Cubicweb] RQL - ** can only one uid restriction per variable (use IN for X if desired)

afayolle afayolle.ml at free.fr
Mon Jan 21 16:19:54 CET 2013


On lun. 21 janv. 2013 15:19:42 CET, Carlos Balderas wrote:
> Hi Alexandre!, I hope you are doing well.
>
> I'd like to fix this as well, do you know where I should start to look
> in logilab libraries to change this?.
> Or If you have a clear clue, you can give me a little orientation so I
> can build a patch and send it to revision.
> May be it is just a validation not to give it for granted, that any
> eid in the WHERE clause is a restriction condition.
>
> Best Regards
> Carlos Balderas
>
>
>
>
> On Mon, Jan 21, 2013 at 2:13 AM, afayolle <afayolle.ml at free.fr
> <mailto:afayolle.ml at free.fr>> wrote:
>
>     On ven. 18 janv. 2013 16:16:30 CET, Carlos Balderas wrote:
>     > Hi List,
>     >
>     > Is it possible to have the "eid" value as returning column in a RQL
>     > Query when using eid in the WHERE clause?
>     >
>     > For instance, running this query leads me to an error
>     >
>     > BadRQLQuery: Any N,I WHERE X is Company, X name N, X eid 5562, X
>     eid I
>     > ** can only one uid restriction per variable (use IN for X if
>     desired)
>     >
>     > Looks like the parser is getting the idea that I am duplicating the
>     > "eid" restriction in the query, instead of assign I to the eid's
>     value.
>     >
>     > (At simple look it might not look very logic, but, we need this
>     value
>     > to be returned for a more complex rql sentence.)
>
>     This has been a long standing RQL limitation that I've hit quite
>     often,
>     even with a single eid limitation in my query because CW silently adds
>     another eid restriction (at least in the getting-older version I'm
>     using).
>
>     I'm interested in a fix for this.
>
>     --
>     Alexandre
>
>
>
>
> --
> Carlos Balderas


I'm sending this back on the list.

I don't have the code at hand. AFAIR, the exception is raised in 
rql/stcheck.py. The code responsible for the addition of the eid 
restriction used to be in a method called add_eid_restriction, but I 
can't remember where this one lives or where it is called.

--
Alexandre



More information about the Cubicweb mailing list