[Cubicweb] annotating divs with rql and vid
pierre-yves.david at logilab.fr
Thu May 24 18:09:07 CEST 2012
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.
__vargs__ = ('arg1', 'arg2', 'arg3')
def call(arg1, arg2='babar', arg3='celestine'):
self.arg1 = arg1
self.arg2 = arg2
self.arg3 = arg3
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.
ps: no, we won't do method introspection to search for argument name !
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the Cubicweb