Thank's in advance.
On 5 ene, 14:11, mdipierro <[email protected]> wrote:
> This is not a stupid question. But the answer depends on the details.
> So I am going to provide multiple answers.
>
> First of all next=... must be the name of an action, not a complete
> URL as returned by t2.action.
> Second you should try avoid ../../ because URLs containing those are
> rejected by web2py. web2py interprets .. as an attempt of directpry
> traversal attack.
>
> 1) say you have a page wiki/one that contains
>
> {{=self.create(db.beneficiarios,next='wiki/two')}}
>
> this means that after creating a beneficiario, you want to redirect to
> page wiki/two
> if this is what you want to do you must create the wiki page
> "two" (menu false if this is only reachable by this redirection) and
> in the page call {{programfetcha()}}. This page does not need to
> display anything since it only performs a redirection. the function
> prografetcha does not need any decorator since it is inly exposed via
> the wiki page. I call it a wiki page but in reality wiki/two is just a
> user defined action.
>
> 2) You can avoid using wiki/two by exposing programfetcha directly. In
> this case you need the decorator @expose and the wiki/one should say
>
> {{=self.create(db.beneficiarios,next='run/programfetcha')}}
>
> Massimo
>
> On Jan 5, 1:29 pm, drayco <[email protected]> wrote:
>
> > Hi, I try to use t3 and I need to @expose procedure if i want to use
> > it in a wiki page in a self.create() method.
>
> > This is my procedure that i need to use
>
> > @expose
> > def programafecha():
> > beneficiarios=db(db.beneficiarios.person_id==self.person_id).select
> > ()
> > trabajadores=db(db.trabajadores.person_id==self.person_id).select
> > ()
> > coordinadores=db(db.coordinadores.id==trabajadores
> > [0].coordinador).select()
> > fechasValidas=db((db.fechas.regional==coordinadores[0].regional)&
> > (db.fechas.full<24)).select()
> > for beneficiario in beneficiarios:
> > if beneficiario.fecha_Tramite==0:
> > db(db.beneficiarios.id==beneficiario.id).update
> > (fecha_Tramite=fechasValidas[0].id)
> > db(db.fechas.id==fechasValidas[0].id).update(full=
> > (fechasValidas[0].full+1))
>
> > self.redirect('wiki/inftrabajador')
>
> > In a wiki page i do this
>
> > {{=self.create(db.beneficiarios,next=self.action('../../../run/
> > programafecha'))}}
>
> > How can I use in t3 private procedure in a wiki page whitout @expose?
>
> > I am so sorry, if this is a stupid question.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---