[Cubicweb] annotating divs with rql and vid
aurelien.campeas at logilab.fr
Thu May 24 18:35:00 CEST 2012
Le 24/05/2012 18:09, Pierre-Yves David a écrit :
> On Thu, May 24, 2012 at 05:39:02PM +0200, Sylvain Thénault wrote:
>> On 24 mai 17:25, Pierre-Yves David wrote:
>>>> Giving argument to view is only part of the pb. Handling them dynamically
>>>> in e.g. facets context without transmitting information all along the way
>>>> is my concerns here.
>>> Why is it a concern to transmit information all along the way ?
>>> I'm curious to see your usecase requiring such optimisation.
>> If you want to recall the view by an ajax call from the web ui, you
>> need this information.
> Right, the ticket does not explain this part.
> In the pylos implementation, we explicitly declare possible argument for view.
> This explicit declaration allows to automatically get current argument value
> when generating ajax URL. Each argument values are expected to be found in
> attributes with the same name than the argument.
> class MyView(self):
> __vargs__ = ('arg1', 'arg2', 'arg3')
> def call(arg1, arg2='babar', arg3='celestine'):
> self.arg1 = arg1
> self.arg2 = arg2
> self.arg3 = arg3
what about having the __vargs__ automatically computed by default ?
> This explicit arguments declaration is a small price to pay to get simple and
> intuitive persistent parameter for view. In core cubicweb, this "only" requires:
> - proper controler handling of "vidargs"
> - unified way to generate ajax url.
> Again, We have this kind of mechanism implemented in Pylos and it works great.
ah ? I had forgotten about it ...
More information about the Cubicweb