Perfect, the code is already fixed, Thanks.
El 03/09/15 a las 11:11, Anthony escribió:
Actually, there's a bigger problem. In Python, default arguments are
evaluated when the function is first defined, so all of your default
arguments will be set when the module is first imported. Therefore,
all references to the "current" object in the default arguments will
be fixed to the values of the first request (when the module is first
imported). Those values will not change on subsequent requests.
Instead, all of those arguments should be set to some other default
(such as None), and then re-set using "current" within the function
body, as Niphlod suggests.
Anthony
On Thursday, September 3, 2015 at 10:46:49 AM UTC-4, Niphlod wrote:
On Thursday, September 3, 2015 at 7:22:52 AM UTC+2, Carlos Cesar
Caballero wrote:
Hi Niphlod, many thanks for your suggestions, The main problem
with web2pyslices.com <http://web2pyslices.com> is that I
can't publish anything and I don't know why, I mentioned this
in other threads.
About the default value in argument, I can change it, but why
you prefer default to None?
It'll be easier to read.
For web2pyslices.com <http://web2pyslices.com> let's wait for
@spametki to chime in...
--
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 [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
Este mensaje le ha llegado mediante el servicio de correo electronico que
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema
Nacional de Salud. La persona que envia este correo asume el compromiso de usar
el servicio a tales fines y cumplir con las regulaciones establecidas
Infomed: http://www.sld.cu/
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.