Hello,

Thank you :) I will use the property decoration :)

Cdt,

Le mercredi 19 novembre 2014 12:50:28 UTC+1, apoirier a écrit :
>
> Le 18 nov. 2014 à 14:22, Amine Salmen Rekik <amine...@gmail.com 
> <javascript:>> a écrit : 
> > 
> > Hi :) 
> > Thank you for you replay 
> > 
> >> Why in your case aren’t you able to that? Why to you abolutely need to 
> initialized 
> >> it in a @presentation.init_for function? 
> > 
> > I don't like to initialize the component in the init function because 
> when the function selectMenu is invoked, my application loads the data from 
> the database. 
> > 
> > So when we set the menu name in the URL, the selectMenu function is 
> invoked twice ( the first one in the _init_ function and the second one in 
> @presentation.init_for function)  . As a consequence, we will have 2 
> requests to the database and we will load unused data. 
>
> Then, to me it looks like you want to defer the initialization of your 
> objects on 
> their first access. In your example that can simply be done by using a 
> ‘content’ 
> property (full modifications in the file in attachment): 
>
>   @property 
>   def content(self): 
>       if not self._content(): 
>           self._content.becomes(self.menuItems[0]) 
>       return self._content 
>
> > My idea is to invoke the selectMenu (request data) in the 
> @presentation.init_for function: If the menu name is specified, the 
> application loads the appropriate data, otherwise we load the data of the 
> first menu. 
> > 
> > Best regards, 
> > Amine 
>
>
> Best regards, 
> Alain 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Nagare users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nagare-users+unsubscr...@googlegroups.com.
To post to this group, send email to nagare-users@googlegroups.com.
Visit this group at http://groups.google.com/group/nagare-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to