[Cubicweb] annotating divs with rql and vid

Aurélien Campéas aurelien.campeas at logilab.fr
Fri May 25 14:26:22 CEST 2012


Le 25/05/2012 14:08, Pierre-Yves David a écrit :
> On Fri, May 25, 2012 at 02:07:10PM +0200, Aurélien Campéas wrote:
>> Le 25/05/2012 11:19, Pierre-Yves David a écrit :
>>> On Thu, May 24, 2012 at 06:35:00PM +0200, Aurélien Campéas wrote:
>>>> 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:
>>>>> example:
>>>>>
>>>>>      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 ?
>>>
>>> How would you compute that ?
>>>
>>
>> python has this funny thing called "introspection" :-p
>
> I'm not sure magic are welcome here
>
> In one of my previous email:
>
>> ps: no, we won't do method introspection to search for argument name !
>
>

Let's agree to disagree. Also I was talking about a default. Like in

class MyView(...):

     @vidargs
     def call(self, a1='babar', a2=42):
         ....


vs explicit:

     @vidargs('a2')
     def call(self, a1='babar', a2=42):
         ....


More information about the Cubicweb mailing list