Re: [web2py] add_button to go to the previous page

2017-01-12 Thread Dave S
On Thursday, January 12, 2017 at 11:50:16 AM UTC-8, Dave S wrote:
>
>
>
> On Thursday, January 12, 2017 at 11:36:32 AM UTC-8, Andrea Fae' wrote:
>>
>> request.env.http_referer contains all URL starting with http://..., I 
>> need the last part after /. Thank you
>>
>
> Python has the urlparse functions.  Indeed, web2py uses that stuff.
> 
>
>
>

Note that the REFERRER might not exist if the user has directly entered the 
URL.

 

> /dps
>

-d
 

>  
>
>>
>> Il giorno giovedì 12 gennaio 2017 18:45:58 UTC+1, Gaurav Vichare ha 
>> scritto:
>>>
>>> request.env.http_referer contains link to the referrer page, i. e. 
>>> previous page!
>>>
>>> On Thursday, January 12, 2017 at 7:55:26 PM UTC+5:30, Andrea Fae' wrote:

 I don't know what is the previous page because this page can come from 
 different pages...this is the problem...I want to reference the previous 
 page... thank you

 Il giorno martedì 10 gennaio 2017 11:48:42 UTC+1, Áureo Dias Neto ha 
 scritto:
>
> example:
>
> form.add_button("Annulla",URL('default','index'))
>
> 2017-01-10 8:47 GMT-02:00 Áureo Dias Neto :
>
>> with this:
>>
>> form.add_button("Annulla",URL( 'CONTROLLER' , 'FUNCTION_NAME' ))
>>
>> 2017-01-10 8:44 GMT-02:00 Andrea Fae' :
>>
>>> I have this situation
>>> form = crud.update(db.pc, pc, onaccept=crud.archive, 
>>> deletable=False, next='lista_pc')
>>> form.add_button("Annulla",URL('lista_pc'))
>>> 
>>> I want that button "annulla" go in the previus page, not in the 
>>> 'lista_pc'.
>>> How to do?
>>> thank you
>>>
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, 
>>> send an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] add_button to go to the previous page

2017-01-12 Thread Gael Princivalle
I use this solution, not so 'beautiful' but it works.

In the layout I save the current URL like this:
{{current_url = URL(args=request.args, vars=request.get_vars)}}
I do it in the layout like that I'm sure to always doing it.

After that you can add where you need it in a link this current_url as a 
var, for using it for turning back to the previous page.

Il giorno giovedì 12 gennaio 2017 20:36:32 UTC+1, Andrea Fae' ha scritto:
>
> request.env.http_referer contains all URL starting with http://..., I need 
> the last part after /. Thank you
>
> Il giorno giovedì 12 gennaio 2017 18:45:58 UTC+1, Gaurav Vichare ha 
> scritto:
>>
>> request.env.http_referer contains link to the referrer page, i. e. 
>> previous page!
>>
>> On Thursday, January 12, 2017 at 7:55:26 PM UTC+5:30, Andrea Fae' wrote:
>>>
>>> I don't know what is the previous page because this page can come from 
>>> different pages...this is the problem...I want to reference the previous 
>>> page... thank you
>>>
>>> Il giorno martedì 10 gennaio 2017 11:48:42 UTC+1, Áureo Dias Neto ha 
>>> scritto:

 example:

 form.add_button("Annulla",URL('default','index'))

 2017-01-10 8:47 GMT-02:00 Áureo Dias Neto :

> with this:
>
> form.add_button("Annulla",URL( 'CONTROLLER' , 'FUNCTION_NAME' ))
>
> 2017-01-10 8:44 GMT-02:00 Andrea Fae' :
>
>> I have this situation
>> form = crud.update(db.pc, pc, onaccept=crud.archive, deletable=False, 
>> next='lista_pc')
>> form.add_button("Annulla",URL('lista_pc'))
>> 
>> I want that button "annulla" go in the previus page, not in the 
>> 'lista_pc'.
>> How to do?
>> thank you
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google 
>> Groups "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to web2py+un...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] add_button to go to the previous page

2017-01-12 Thread Dave S


On Thursday, January 12, 2017 at 11:36:32 AM UTC-8, Andrea Fae' wrote:
>
> request.env.http_referer contains all URL starting with http://..., I need 
> the last part after /. Thank you
>

Python has the urlparse functions.  Indeed, web2py uses that stuff.



/dps
 

>
> Il giorno giovedì 12 gennaio 2017 18:45:58 UTC+1, Gaurav Vichare ha 
> scritto:
>>
>> request.env.http_referer contains link to the referrer page, i. e. 
>> previous page!
>>
>> On Thursday, January 12, 2017 at 7:55:26 PM UTC+5:30, Andrea Fae' wrote:
>>>
>>> I don't know what is the previous page because this page can come from 
>>> different pages...this is the problem...I want to reference the previous 
>>> page... thank you
>>>
>>> Il giorno martedì 10 gennaio 2017 11:48:42 UTC+1, Áureo Dias Neto ha 
>>> scritto:

 example:

 form.add_button("Annulla",URL('default','index'))

 2017-01-10 8:47 GMT-02:00 Áureo Dias Neto :

> with this:
>
> form.add_button("Annulla",URL( 'CONTROLLER' , 'FUNCTION_NAME' ))
>
> 2017-01-10 8:44 GMT-02:00 Andrea Fae' :
>
>> I have this situation
>> form = crud.update(db.pc, pc, onaccept=crud.archive, deletable=False, 
>> next='lista_pc')
>> form.add_button("Annulla",URL('lista_pc'))
>> 
>> I want that button "annulla" go in the previus page, not in the 
>> 'lista_pc'.
>> How to do?
>> thank you
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google 
>> Groups "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to web2py+un...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] add_button to go to the previous page

2017-01-12 Thread Andrea Fae'
request.env.http_referer contains all URL starting with http://..., I need 
the last part after /. Thank you

Il giorno giovedì 12 gennaio 2017 18:45:58 UTC+1, Gaurav Vichare ha scritto:
>
> request.env.http_referer contains link to the referrer page, i. e. 
> previous page!
>
> On Thursday, January 12, 2017 at 7:55:26 PM UTC+5:30, Andrea Fae' wrote:
>>
>> I don't know what is the previous page because this page can come from 
>> different pages...this is the problem...I want to reference the previous 
>> page... thank you
>>
>> Il giorno martedì 10 gennaio 2017 11:48:42 UTC+1, Áureo Dias Neto ha 
>> scritto:
>>>
>>> example:
>>>
>>> form.add_button("Annulla",URL('default','index'))
>>>
>>> 2017-01-10 8:47 GMT-02:00 Áureo Dias Neto :
>>>
 with this:

 form.add_button("Annulla",URL( 'CONTROLLER' , 'FUNCTION_NAME' ))

 2017-01-10 8:44 GMT-02:00 Andrea Fae' :

> I have this situation
> form = crud.update(db.pc, pc, onaccept=crud.archive, deletable=False, 
> next='lista_pc')
> form.add_button("Annulla",URL('lista_pc'))
> 
> I want that button "annulla" go in the previus page, not in the 
> 'lista_pc'.
> How to do?
> thank you
>
> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google 
> Groups "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to web2py+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] add_button to go to the previous page

2017-01-12 Thread Gaurav Vichare
request.env.http_referer contains link to the referrer page, i. e. previous 
page!

On Thursday, January 12, 2017 at 7:55:26 PM UTC+5:30, Andrea Fae' wrote:
>
> I don't know what is the previous page because this page can come from 
> different pages...this is the problem...I want to reference the previous 
> page... thank you
>
> Il giorno martedì 10 gennaio 2017 11:48:42 UTC+1, Áureo Dias Neto ha 
> scritto:
>>
>> example:
>>
>> form.add_button("Annulla",URL('default','index'))
>>
>> 2017-01-10 8:47 GMT-02:00 Áureo Dias Neto :
>>
>>> with this:
>>>
>>> form.add_button("Annulla",URL( 'CONTROLLER' , 'FUNCTION_NAME' ))
>>>
>>> 2017-01-10 8:44 GMT-02:00 Andrea Fae' :
>>>
 I have this situation
 form = crud.update(db.pc, pc, onaccept=crud.archive, deletable=False, 
 next='lista_pc')
 form.add_button("Annulla",URL('lista_pc'))
 
 I want that button "annulla" go in the previus page, not in the 
 'lista_pc'.
 How to do?
 thank you

 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to the Google 
 Groups "web2py-users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] add_button to go to the previous page

2017-01-12 Thread Áureo Dias Neto
I do not know if this is the best way to do this, because it is not very
practical if you have several pages ..

2017-01-12 14:14 GMT-02:00 Áureo Dias Neto :

> you can take this:
>
> if user is in PageA, and click a button to go to another page, pass the
> name of the actual page as arg, before redirect.. example:
>
> -user is in PageA:
> on the button that redirect to another X page:
>
> form.add_button("Annulla",URL('default','PageX',args='PageA'))
>
>
> when user is on the PageX; you can fetch the arg on URL to back to PageA:
>
> previous_page = request.args(0)
>
> and the button to back to previous page:
>
> form.add_button("Annulla",URL('default',previous_page ))
>
> 2017-01-12 12:25 GMT-02:00 Andrea Fae' :
>
>> I don't know what is the previous page because this page can come from
>> different pages...this is the problem...I want to reference the previous
>> page... thank you
>>
>> Il giorno martedì 10 gennaio 2017 11:48:42 UTC+1, Áureo Dias Neto ha
>> scritto:
>>>
>>> example:
>>>
>>> form.add_button("Annulla",URL('default','index'))
>>>
>>> 2017-01-10 8:47 GMT-02:00 Áureo Dias Neto :
>>>
 with this:

 form.add_button("Annulla",URL( 'CONTROLLER' , 'FUNCTION_NAME' ))

 2017-01-10 8:44 GMT-02:00 Andrea Fae' :

> I have this situation
> form = crud.update(db.pc, pc, onaccept=crud.archive, deletable=False,
> next='lista_pc')
> form.add_button("Annulla",URL('lista_pc'))
>
> I want that button "annulla" go in the previus page, not in the
> 'lista_pc'.
> How to do?
> thank you
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google
> Groups "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to web2py+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


>>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] add_button to go to the previous page

2017-01-12 Thread Áureo Dias Neto
you can take this:

if user is in PageA, and click a button to go to another page, pass the
name of the actual page as arg, before redirect.. example:

-user is in PageA:
on the button that redirect to another X page:

form.add_button("Annulla",URL('default','PageX',args='PageA'))


when user is on the PageX; you can fetch the arg on URL to back to PageA:

previous_page = request.args(0)

and the button to back to previous page:

form.add_button("Annulla",URL('default',previous_page ))

2017-01-12 12:25 GMT-02:00 Andrea Fae' :

> I don't know what is the previous page because this page can come from
> different pages...this is the problem...I want to reference the previous
> page... thank you
>
> Il giorno martedì 10 gennaio 2017 11:48:42 UTC+1, Áureo Dias Neto ha
> scritto:
>>
>> example:
>>
>> form.add_button("Annulla",URL('default','index'))
>>
>> 2017-01-10 8:47 GMT-02:00 Áureo Dias Neto :
>>
>>> with this:
>>>
>>> form.add_button("Annulla",URL( 'CONTROLLER' , 'FUNCTION_NAME' ))
>>>
>>> 2017-01-10 8:44 GMT-02:00 Andrea Fae' :
>>>
 I have this situation
 form = crud.update(db.pc, pc, onaccept=crud.archive, deletable=False,
 next='lista_pc')
 form.add_button("Annulla",URL('lista_pc'))

 I want that button "annulla" go in the previus page, not in the
 'lista_pc'.
 How to do?
 thank you

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to the Google
 Groups "web2py-users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] add_button to go to the previous page

2017-01-12 Thread Andrea Fae'
I don't know what is the previous page because this page can come from 
different pages...this is the problem...I want to reference the previous 
page... thank you

Il giorno martedì 10 gennaio 2017 11:48:42 UTC+1, Áureo Dias Neto ha 
scritto:
>
> example:
>
> form.add_button("Annulla",URL('default','index'))
>
> 2017-01-10 8:47 GMT-02:00 Áureo Dias Neto  >:
>
>> with this:
>>
>> form.add_button("Annulla",URL( 'CONTROLLER' , 'FUNCTION_NAME' ))
>>
>> 2017-01-10 8:44 GMT-02:00 Andrea Fae' :
>>
>>> I have this situation
>>> form = crud.update(db.pc, pc, onaccept=crud.archive, deletable=False, 
>>> next='lista_pc')
>>> form.add_button("Annulla",URL('lista_pc'))
>>> 
>>> I want that button "annulla" go in the previus page, not in the 
>>> 'lista_pc'.
>>> How to do?
>>> thank you
>>>
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to web2py+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] add_button to go to the previous page

2017-01-10 Thread Áureo Dias Neto
example:

form.add_button("Annulla",URL('default','index'))

2017-01-10 8:47 GMT-02:00 Áureo Dias Neto :

> with this:
>
> form.add_button("Annulla",URL( 'CONTROLLER' , 'FUNCTION_NAME' ))
>
> 2017-01-10 8:44 GMT-02:00 Andrea Fae' :
>
>> I have this situation
>> form = crud.update(db.pc, pc, onaccept=crud.archive, deletable=False,
>> next='lista_pc')
>> form.add_button("Annulla",URL('lista_pc'))
>>
>> I want that button "annulla" go in the previus page, not in the
>> 'lista_pc'.
>> How to do?
>> thank you
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] add_button to go to the previous page

2017-01-10 Thread Áureo Dias Neto
with this:

form.add_button("Annulla",URL( 'CONTROLLER' , 'FUNCTION_NAME' ))

2017-01-10 8:44 GMT-02:00 Andrea Fae' :

> I have this situation
> form = crud.update(db.pc, pc, onaccept=crud.archive, deletable=False,
> next='lista_pc')
> form.add_button("Annulla",URL('lista_pc'))
>
> I want that button "annulla" go in the previus page, not in the 'lista_pc'.
> How to do?
> thank you
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.