Re: [web2py] Como mostrar a imagem no HTML com web2py

2019-08-09 Thread Marco Mansilla
Actually the download method is written in the default controller,  unless
you have written your own function in template.

{{=IMG(_src=URL('default','download', auth_user.foto))}}

Anyway, could you provide the auth_user table definition?, did you add
extra fields?, Since auth_user.foto.file should return an error,
auth_user.foto should be an upload field to return the file name, if it is
a blob field you should put the result in src with no url.

El mar., 6 de ago. de 2019 12:22, Kimus  escribió:

> olha eu aqui dnv  :)
>
> Estou com um problema eu insiro uma imagem no banco mas na hr de mostrar
> no HTML não consigo de jeito nem um, eu nãoi to  usando o template do
> web2py então td pra mim é mais dificil alguem teria algum jeito de fazer
>
> OBS : eu coloquei um campo extra_field no auth_user como foto e queria
> exibir essa foto, só que não utilizo quase nd do que o web2py tem pronto
> tipo sqlform grid essas coisas dai tenho que fazer mais manual a coisa
> alguem teria como me dar uma luz
>
> To tentando algo do genero  tentei usar a função download que ta na
> default só que no meu controller só que ainda não funciona quando salvo a
> imagem ela upa a imagem no upload  tipo auth_user.foto e uma hash só qe não
> consigo fazer funcionar msm alguem me ajuda :(
>
> 
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/9131340d-6d7a-4d8f-bfa1-3fc0b0001ba7%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEz031eXFvo%2BvbkzG3jWw1QKjm%2B%3D0ByCrRFbG_kYxfsPWO%2BeaA%40mail.gmail.com.


Re: [web2py] Re: new DBAPI in pydal for both web2py and web3py

2019-05-18 Thread Marco Mansilla
This one sounds good to me, since we already have stupid.css

El sáb., 18 de may. de 2019 09:51, 黄祥 
escribió:

> restQL sounds OK.  Very generic, but it does what it says on the tin.
>> What about stupidQL?   :)  ok just kidding!
>>
>
> like the idea, it can read as :
> restQL = restkill
> stupidQL = stupidkill
>
> just my imagination by cranberries
>
> best regards,
> stifan
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/10a30a90-2c6b-4b33-9dfd-54e59c433d4f%40googlegroups.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEz031ffrAtecw8Ldnd5AGBHUuCfRoaTvcK36T77Zg%3Dz91exSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Run JAVA script in controller.

2019-02-14 Thread Marco Mansilla
Have you tried

   response.js = ""

Should help.

El jue., 14 de feb. de 2019 12:14, Ben Duncan  escribió:

> Is it possible to fire off a java script in the controller .py file?
>
> i.e.:
> if in_form.process(session=None, formname='login').accepted:
> response.flash = 'form accepted'
>
>[ << JAVASCRIPT FIRES OFF HERE>>]
>
> elif in_form.errors:
> response.flash = 'form has errors'
> else:
> response.flash = 'please fill the form'
>
> Thanks ...
>
> *Ben Duncan*
> DBA / Chief Software Architect
> Mississippi State Supreme Court
> Electronic Filing Division
>
> --
> 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] DAL unique on multiple fields

2018-10-14 Thread Marco Mansilla
You can add it right after table definition or BEFORE validation in
controller and it should work.

El dom., 14 de oct. de 2018 13:03, lucas  escribió:

> I didn't think so, so I was making sure.  I added it under onvalidation
> under the controller.  and also added it to the Postgres database as a
> custom index.  thank you for verifying with me.  Lucas
>
> --
> 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] DAL unique on multiple fields

2018-10-14 Thread Marco Mansilla
No,  but you can use  requires=IS_NOT_IN_DB(table, query), if you need to
make a self reference to the table you must write it after table definiton
or in controller before calling the validator,  and can be applied to
multiple fields on the same table.

Hope it helps.

El dom., 14 de oct. de 2018 09:34, lucas  escribió:

> hello one and all,
>
> is there a DAL level way to impose a constraint on a single table but
> unique on multiple fields within that single table?
>
> thanx in advance, lucas
>
> --
> 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] insecure string pickle version 2.17.1

2018-09-18 Thread Marco Mansilla
No es un problema nuevo,

https://groups.google.com/forum/m/#!topic/web2py/P-dU23VOO3o

La solucion propuesta de Mirek Zvolský.

1 hacer un respaldo y eliminar database/*.table

2 en db=DAL(...) agregar db=DAL(..., fake_migrate=True),  ya sea db.py o
definir la variable en private/appconfig

3 actualizar cualquier pagina de la aplicación

4 borrar la definición de fake_migrate

**IMPORTANTE** HACER EL RESPALDO DE databases/*.table.
El dom., 16 de sep. de 2018 20:33, Mayra Marticorena <
marticorenama...@gmail.com> escribió:

> Buenos dias como estan ?
>
> Mediante una migración de una aplicación para pasarla aun sitio web que
> esta en dominio.
> Me ha tirado el siguiente error :
>
> [image: Screenshot_1.png]
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Tengo la base corrupta?
>
> Me podrían ayudar con este tema ?
>
> Esto me paso cuando lo pase a una versiona mas superior de web2py , donde
> en la version 2.14 no me ha dado problema, y por lo visto exiiste un
> controlador nuevo en web2py 2.17 migrator.py que no estaba en las antiguas
> versiones
>
> Saludos.
>
> --
> 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] Re: How to handle routing

2018-07-03 Thread marco mansilla
I'm responding to myself since noticed a related issue on this thread.

After setting myapp as default app in routes.py whenever I try to redirect 
doing;

  
redirect(URL('newcontroller','index'))

server responds with 

invalid function (default/newcontroller)

Any hints on this?.

also (maybe a non-related issue), when using vue-router and refreshing page 
it would break the app, since most of the times the route doesn't exist as 
controllers in the server.

Marco.

On Tuesday, June 26, 2018 at 4:29:49 PM UTC-3, marco mansilla wrote:
>
> Thank you Anthony, this fixed the issue on development, and on production 
> should exist non.
>
> Adding web2cli as default app solved the problem.
>
> Oh, and just noticed I didn't send the link of the app [0] in the first 
> email. My bad.
>
> [0]  https://github.com/marcomansilla/web2cli
>
> Marco.
>
> On Tuesday, June 26, 2018 at 12:59:19 AM UTC-3, Anthony wrote:
>>
>> You could also use routes.py to remove the app name in development.
>>
>> Anthony
>>
>> On Monday, June 25, 2018 at 8:27:29 PM UTC-4, marco mansilla wrote:
>>>
>>> Thanks Dave,  I'll try ASAP. 
>>>
>>> El lun., 25 de jun. de 2018 21:25, Dave S  escribió:
>>>
>>>>
>>>>
>>>> On Monday, June 25, 2018 at 4:51:31 PM UTC-7, marco mansilla wrote:
>>>>>
>>>>> Hi everyone, I have written this small simple test [0], which uses 
>>>>> vue-cli and inside web2py (yes, another test). It works pretty simple.
>>>>>
>>>>> 1- generate a devel project (name can be anything) the web2py app with 
>>>>> vue-cli
>>>>> 2- replace /views/layout.html with /deve/index.html
>>>>> 3- the boundle.js from devel project it redirected to be generated in 
>>>>> static/js/ by editing webpack.config.js inside devel project
>>>>>
>>>>> so far, so good it works.
>>>>>
>>>>> The issue I found, is since Vue works on the client side I can't use 
>>>>> URL(), so when I need to write a links has the app name in it 
>>>>> http://localhost:8000/myapp/foo/bar, on development it works, but in 
>>>>> production using routes.py urls change to http://mydomain.com/foo/bar, 
>>>>> so, the urls inside the files do not work.
>>>>>
>>>>> In the example app I have a simple table on a minimal api, as you can 
>>>>> see in web2cli/devel/src/components/People.vue the axios call has the app 
>>>>> name in it when moving to production it becomes an issue. Since web2py 
>>>>> does 
>>>>> all the work on the server I know it is not possible to use URL() and any 
>>>>> native helpers from the client, does anyone has experienced similar 
>>>>> issues?
>>>>>
>>>>> Marco.
>>>>>
>>>>
>>>> Parse window.location.href or window.location.pathname? 
>>>>
>>>> 
>>>>
>>>> If you're doing AJAX, StackOverflow  Question 1034621 mentions
>>>> ${pageContext.request.contextPath}   // append "//controller/function" 
>>>> as needed
>>>>
>>>> /dps
>>>>
>>>> -- 
>>>> 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] Re: How to handle routing

2018-06-26 Thread marco mansilla
Thank you Anthony, this fixed the issue on development, and on production 
should exist non.

Adding web2cli as default app solved the problem.

Oh, and just noticed I didn't send the link of the app [0] in the first 
email. My bad.

[0]  https://github.com/marcomansilla/web2cli

Marco.

On Tuesday, June 26, 2018 at 12:59:19 AM UTC-3, Anthony wrote:
>
> You could also use routes.py to remove the app name in development.
>
> Anthony
>
> On Monday, June 25, 2018 at 8:27:29 PM UTC-4, marco mansilla wrote:
>>
>> Thanks Dave,  I'll try ASAP. 
>>
>> El lun., 25 de jun. de 2018 21:25, Dave S > > escribió:
>>
>>>
>>>
>>> On Monday, June 25, 2018 at 4:51:31 PM UTC-7, marco mansilla wrote:
>>>>
>>>> Hi everyone, I have written this small simple test [0], which uses 
>>>> vue-cli and inside web2py (yes, another test). It works pretty simple.
>>>>
>>>> 1- generate a devel project (name can be anything) the web2py app with 
>>>> vue-cli
>>>> 2- replace /views/layout.html with /deve/index.html
>>>> 3- the boundle.js from devel project it redirected to be generated in 
>>>> static/js/ by editing webpack.config.js inside devel project
>>>>
>>>> so far, so good it works.
>>>>
>>>> The issue I found, is since Vue works on the client side I can't use 
>>>> URL(), so when I need to write a links has the app name in it 
>>>> http://localhost:8000/myapp/foo/bar, on development it works, but in 
>>>> production using routes.py urls change to http://mydomain.com/foo/bar, 
>>>> so, the urls inside the files do not work.
>>>>
>>>> In the example app I have a simple table on a minimal api, as you can 
>>>> see in web2cli/devel/src/components/People.vue the axios call has the app 
>>>> name in it when moving to production it becomes an issue. Since web2py 
>>>> does 
>>>> all the work on the server I know it is not possible to use URL() and any 
>>>> native helpers from the client, does anyone has experienced similar issues?
>>>>
>>>> Marco.
>>>>
>>>
>>> Parse window.location.href or window.location.pathname? 
>>>
>>> 
>>>
>>> If you're doing AJAX, StackOverflow  Question 1034621 mentions
>>> ${pageContext.request.contextPath}   // append "//controller/function" 
>>> as needed
>>>
>>> /dps
>>>
>>> -- 
>>> 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] Re: How to handle routing

2018-06-25 Thread Marco Mansilla
Thanks Dave,  I'll try ASAP.

El lun., 25 de jun. de 2018 21:25, Dave S  escribió:

>
>
> On Monday, June 25, 2018 at 4:51:31 PM UTC-7, marco mansilla wrote:
>>
>> Hi everyone, I have written this small simple test [0], which uses
>> vue-cli and inside web2py (yes, another test). It works pretty simple.
>>
>> 1- generate a devel project (name can be anything) the web2py app with
>> vue-cli
>> 2- replace /views/layout.html with /deve/index.html
>> 3- the boundle.js from devel project it redirected to be generated in
>> static/js/ by editing webpack.config.js inside devel project
>>
>> so far, so good it works.
>>
>> The issue I found, is since Vue works on the client side I can't use
>> URL(), so when I need to write a links has the app name in it
>> http://localhost:8000/myapp/foo/bar, on development it works, but in
>> production using routes.py urls change to http://mydomain.com/foo/bar,
>> so, the urls inside the files do not work.
>>
>> In the example app I have a simple table on a minimal api, as you can see
>> in web2cli/devel/src/components/People.vue the axios call has the app name
>> in it when moving to production it becomes an issue. Since web2py does all
>> the work on the server I know it is not possible to use URL() and any
>> native helpers from the client, does anyone has experienced similar issues?
>>
>> Marco.
>>
>
> Parse window.location.href or window.location.pathname?
>
> 
>
> If you're doing AJAX, StackOverflow  Question 1034621 mentions
> ${pageContext.request.contextPath}   // append "//controller/function" as
> needed
>
> /dps
>
> --
> 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.


[web2py] How to handle routing

2018-06-25 Thread marco mansilla
Hi everyone, I have written this small simple test [0], which uses vue-cli 
and inside web2py (yes, another test). It works pretty simple.

1- generate a devel project (name can be anything) the web2py app with 
vue-cli
2- replace /views/layout.html with /deve/index.html
3- the boundle.js from devel project it redirected to be generated in 
static/js/ by editing webpack.config.js inside devel project

so far, so good it works.

The issue I found, is since Vue works on the client side I can't use URL(), 
so when I need to write a links has the app name in it 
http://localhost:8000/myapp/foo/bar, on development it works, but in 
production using routes.py urls change to http://mydomain.com/foo/bar, so, 
the urls inside the files do not work.

In the example app I have a simple table on a minimal api, as you can see 
in web2cli/devel/src/components/People.vue the axios call has the app name 
in it when moving to production it becomes an issue. Since web2py does all 
the work on the server I know it is not possible to use URL() and any 
native helpers from the client, does anyone has experienced similar issues?

Marco.

-- 
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.


[web2py] Re: API Response workaround

2018-06-23 Thread marco mansilla
Sorry, totally forgot about this, and yes... my problem was the lack of 
errors at all, so, using APIMaker, which is very convenient, changed insert 
and update methods with validate_and_insert, validate_and_update 
respectively. Now I can che the errors counter in the response.

On Tuesday, November 14, 2017 at 10:13:45 PM UTC-3, Leonel Câmara wrote:
>
> For me, it's good that the API returns 200 OK and a dict with the errors. 
> Why do you think 404 would be a good status code? The URL exists, you just 
> called it with data that did not validate. Still, if that's what you really 
> want just check for errors in the validate_and_insert and "raise HTTP(404)" 
> if there are any. 
>

-- 
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.


[web2py] [OFF TOPIC] Telegram Group for Web2py users

2018-05-02 Thread marco mansilla
I know this is the main communication channel for web2py users community, 
but just in case anyone wants some interactivity I have created 
https://t.me/web2py


Marco.

-- 
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] How do I upload the .w2py file?

2018-04-03 Thread Marco Mansilla
Is it an app or a plugin?, What's the original file name?.

Marco.

El mié., 4 de abr. de 2018 01:28, Alejandra Montiel Saavedra <
alemontiels...@gmail.com> escribió:

>
> Yes, I'm wrong with the name of the format, but how can I install it in
> web2py, what happens is that they passed me a file.w2p and I reinstalled it
> in web2py because it generated an error "unabled to install application" .
>
> 2018-04-03 22:38 GMT-05:00 Marco Mansilla <thebigsho...@gmail.com>:
>
>> The file name should be  myFile.w2p not w2py. It is just a tar.gz file.
>>
>> Marco
>>
>> El mar., 3 de abr. de 2018 22:45, Alejandra Montiel Saavedra <
>> alemontiels...@gmail.com> escribió:
>>
>>>
>>> I have a file of .w2py format, I uploaded it in web2py and generated an
>>> error "Unable to install application". Could you help me upload it or can I
>>> open or view the folders inside the .w2py, please.
>>>
>>> --
>>> 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.
>>
>
> --
> 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] How do I upload the .w2py file?

2018-04-03 Thread Marco Mansilla
The file name should be  myFile.w2p not w2py. It is just a tar.gz file.

Marco

El mar., 3 de abr. de 2018 22:45, Alejandra Montiel Saavedra <
alemontiels...@gmail.com> escribió:

>
> I have a file of .w2py format, I uploaded it in web2py and generated an
> error "Unable to install application". Could you help me upload it or can I
> open or view the folders inside the .w2py, please.
>
> --
> 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] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-28 Thread Marco Mansilla
Thanks Massimo, so far it working fine. JS code is a lot more cleaner and
no need for node which is nice.

We just need native support from browsers and clients to update to latest
versions.

Marco.

El mié., 28 de mar. de 2018 13:47, Massimo Di Pierro <
massimo.dipie...@gmail.com> escribió:

> Good work. This helps me a lot.
>
> On Friday, 23 March 2018 14:07:26 UTC-5, marco mansilla wrote:
>>
>> Just in case anyone is interested I have uploaded a simple test app with
>> VueJS as modules in the browser.
>>
>> Did it to test and see how it works, as a demo someone could find it
>> useful, more info in the readme file.
>>
>> https://github.com/marcomansilla/yava
>>
>> Opinions are always welcome and appreciated.
>>
>> --
>> -BEGIN GEEK CODE BLOCK-
>> version 3.1
>> GCS/GTW/| d? s+:+>+++ a-- C+++(+) UL>$ P++>+++ L+++>+$ E->+ W++>+
>> N>+++ o K- w---()
>> O(--) M>-- V-- PS++ PE++>+ Y-->+ PGP+>+++ t-(?) 5? X++ R+ !tv b+++>
>> DI+++ D--- G+++>+
>> e+++> h* r++>+++ y++
>> --END GEEK CODE BLOCK--
>>
> --
> 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] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-24 Thread Marco Mansilla
Perfect, Chrome support is set by default, I guess Firefox will do the same
un the next versión, currently 59.1 still  needs manual activation for this
feature.

El sáb., 24 de mar. de 2018 18:43, Gualter Portella <gualte...@gmail.com>
escribió:

> Thanks, Marco.
>
> It was just a browser support issue with firefox.
>
>
>
> Em sexta-feira, 23 de março de 2018 16:07:26 UTC-3, marco mansilla
> escreveu:
>>
>> Just in case anyone is interested I have uploaded a simple test app with
>> VueJS as modules in the browser.
>>
>> Did it to test and see how it works, as a demo someone could find it
>> useful, more info in the readme file.
>>
>> https://github.com/marcomansilla/yava
>>
>> Opinions are always welcome and appreciated.
>>
>> --
>> -BEGIN GEEK CODE BLOCK-
>> version 3.1
>> GCS/GTW/| d? s+:+>+++ a-- C+++(+) UL>$ P++>+++ L+++>+$ E->+ W++>+
>> N>+++ o K- w---()
>> O(--) M>-- V-- PS++ PE++>+ Y-->+ PGP+>+++ t-(?) 5? X++ R+ !tv b+++>
>> DI+++ D--- G+++>+
>> e+++> h* r++>+++ y++
>> --END GEEK CODE BLOCK--
>>
> --
> 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] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-24 Thread Marco Mansilla
Oh, and check browsers support, Firefox needs the extra step mentioned in
the readme file.

El sáb., 24 de mar. de 2018 12:37, Gualter Portella 
escribió:

> Thank you for the initiative! I am looking forward to learning vue.js and
> using it together with web2py. One minor problem is that I am not still
> getting the message Into the index page correctly. It only comes in the
> form of ${message}. What I might be doing wrong?
> Cheers
>
> --
> 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] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-24 Thread Marco Mansilla
Hace you checked the browsers developer console?

You have todo edit/create files inside yava/dev/src and run grunt uglify or
just grunt since the default task is watch and minify to static/vue.

Marco.

PS. Later this afternoon will upload a new branch with no grunt nor
minification.

El sáb., 24 de mar. de 2018 12:37, Gualter Portella 
escribió:

> Thank you for the initiative! I am looking forward to learning vue.js and
> using it together with web2py. One minor problem is that I am not still
> getting the message Into the index page correctly. It only comes in the
> form of ${message}. What I might be doing wrong?
> Cheers
>
> --
> 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] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-23 Thread Marco Mansilla
In addition to improve learning and testing will create minified and
unminified branches

El sáb., 24 de mar. de 2018 02:17, Marco Mansilla <thebigsho...@gmail.com>
escribió:

> Yeah, you're right, but this structure is intended since I use a deploy
> script that would clean dev, errors, sessions and other data
>
> El vie., 23 de mar. de 2018 22:31, 黄祥 <steve.van.chris...@gmail.com>
> escribió:
>
>> yeah, already checked that too, just a suggestion, perhaps better to
>> leave the vue code (under static/vue/*.min.js) unminified, it's make other
>> learn the vue code that integrate with web2py more clearly
>>
>> best regards,
>> stifan
>>
>> --
>> 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] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-23 Thread Marco Mansilla
Yeah, you're right, but this structure is intended since I use a deploy
script that would clean dev, errors, sessions and other data

El vie., 23 de mar. de 2018 22:31, 黄祥 
escribió:

> yeah, already checked that too, just a suggestion, perhaps better to leave
> the vue code (under static/vue/*.min.js) unminified, it's make other learn
> the vue code that integrate with web2py more clearly
>
> best regards,
> stifan
>
> --
> 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] Re: ECMAScript Modules Vue and Web2py - simple test

2018-03-23 Thread Marco Mansilla
You're welcome. Notice the main Vue instance is called only once inside
Index.html and components are imported inside the instance and not called
un the browser.

I hace a few custom init scripts and that's why ommited some steps, but it
should work fine as you did.

Regards.

Marco.

El vie., 23 de mar. de 2018 20:51, 黄祥 
escribió:

> cool, thx for sharing
> *installation and running step :*
> *terminal_0*
> cd path/web2py/applications
> git clone https://github.com/marcomansilla/yava
> cd yava/dev
> npm install
> ./node_modules/.bin/grunt
>
> *terminal_1*
> python path/web2py/web2py.py --nogui --no-banner -a a -i 0.0.0.0 -p 8000
>
> *terminal_2*
> open http://localhost:8000/yava
>
> *tested work* : signup, logout, login
>
> best regards,
> stifan
>
> --
> 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.


[web2py] ECMAScript Modules Vue and Web2py - simple test

2018-03-23 Thread Marco Mansilla
Just in case anyone is interested I have uploaded a simple test app with
VueJS as modules in the browser.

Did it to test and see how it works, as a demo someone could find it
useful, more info in the readme file.

https://github.com/marcomansilla/yava

Opinions are always welcome and appreciated.

-- 
-BEGIN GEEK CODE BLOCK-
version 3.1
GCS/GTW/| d? s+:+>+++ a-- C+++(+) UL>$ P++>+++ L+++>+$ E->+ W++>+
N>+++ o K- w---()
O(--) M>-- V-- PS++ PE++>+ Y-->+ PGP+>+++ t-(?) 5? X++ R+ !tv b+++>
DI+++ D--- G+++>+
e+++> h* r++>+++ y++
--END GEEK CODE BLOCK--

-- 
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] Re: Using vue.js as my front end

2018-03-13 Thread Marco Mansilla
Roberto's work it's really nice and valuable, we still need to drop the
nodejs dependency somehow, and use js tools without worrying about node or
npm. Something like using js modules in the browser would be nice.

You can read about it in the following links.

https://www.contentful.com/blog/2017/04/04/es6-modules-support-lands-in-browsers-is-it-time-to-rethink-bundling/
https://jakearchibald.com/2017/es-modules-in-browsers/
https://pawelgrzybek.com/native-ecmascript-modules-in-the-browser/


2018-03-13 14:08 GMT-03:00 Richard Vézina :

> Maybe here : https://github.com/robertop23/web2py_vuejs_vuetify
>
> There is a initiative to create a scafold web2py app base on vue.js...
>
> Richard
>
> On Tue, Mar 13, 2018 at 1:07 PM, Jim S  wrote:
>
>> Thanks for that!
>>
>> Any example code anywhere on how to implement login and then subsequent
>> page calls passing the logged in user or session information?
>>
>> -Jim
>>
>>
>> On Tuesday, March 13, 2018 at 12:00:44 PM UTC-5, Leonel Câmara wrote:
>>>
>>> Look at AuthAPI which is Auth's base class
>>>
>>> https://github.com/web2py/web2py/blob/master/gluon/authapi.py
>>>
>>> It works pretty much like Auth except that it's based in dictionaries,
>>> its functions get dictionaries as arguments and returns dictionaries, which
>>> is pretty much what people usually want when interacting with JS frontend
>>> frameworks.
>>>
>>> It will probably be easy to subclass it and make your AuthVue class.
>>>
>> --
>> 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.
>



-- 
-BEGIN GEEK CODE BLOCK-
version 3.1
GCS/GTW/| d? s+:+>+++ a-- C+++(+) UL>$ P++>+++ L+++>+$ E->+ W++>+
N>+++ o K- w---()
O(--) M>-- V-- PS++ PE++>+ Y-->+ PGP+>+++ t-(?) 5? X++ R+ !tv b+++>
DI+++ D--- G+++>+
e+++> h* r++>+++ y++
--END GEEK CODE BLOCK--

-- 
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.


[web2py] Re: web2py_osx.zip seems way out of date ???

2018-03-09 Thread marco mansilla
I recently got this problem in Linux Debian, after upgrading web2py, fixed 
with

$sudo pip install pydal -U



On Saturday, February 24, 2018 at 3:03:05 AM UTC-3, jim kaubisch wrote:
>
> Thanks for the reply, Dave.
>
> There have been a number of issues surrounding the last couple of versions 
> of Mac OS which come down to the fact that Apple has tightened security of 
> the core of the system, As a result of that, some third party code doesn't 
> always run because its trying to do things that it probably should never 
> have been able to do, and that are no longer permitted - I was tearing my 
> hair out the last couple of days trying to update my version of pyinstaller 
> with pip failing no matter what I did because the system would not allow it 
> to delete old files that it expected to be able to :(
>
> The problem here may ultimately be tied up with this general issue. I will 
> keep poking at it. It seems I'm the only one who has the problem :(
>
> Jim
>
> On Thursday, February 15, 2018 at 2:05:26 AM UTC-8, Dave S wrote:
>>
>> On Wednesday, February 14, 2018 at 6:23:44 PM UTC-8, jim kaubisch wrote:
>>>
>>> Has no-one else had this problem?
>>>
>>
>> I run web2py on Windows or on linux, and having multiple versions has not 
>> been a problem.  That's the way I usually upgrade, copying my applications 
>> across, and looking for js/css/appadmin changes.   Lets me switch back 
>> easily, and I'm not running anywhere that the size of web2py makes for a 
>> problem.
>>
>> I don't often use a Mac, so I don't know how that environment changes 
>> things, other than some of the key labels.
>>
>> /dps
>>  
>>
>>>
>>>
>>> On Wednesday, February 7, 2018 at 10:47:19 AM UTC-8, jim kaubisch wrote:

 Hi,

 I needed to directed my attention away from my web2py project a few 
 months ago but am now trying to get back into it. 
 A wise Step 1 would seem to be to update from 2.14.6 to the current 
 version (2.16.1 I assume).

 First tried from source but got 

 Traceback (most recent call last):

   File "web2py.py", line 21, in 

 import gluon.widget

   File “./Development/web2py/gluon/__init__.py", line 38, in 

 from .dal import DAL, Field

   File “./Development/web2py/gluon/dal.py", line 17, in 

 from pydal.migrator import Migrator, InDBMigrator

 ImportError: cannot import name InDBMigrator


 I still have 2.14.6 installed (in a separate sub-tree) - is that the 
 problem?


 so I downloaded the mac "mac_osx.zip" to try that but - 

 after unzipping, when I try to run the resulting web2py/web2py.app I 
 just get a pop up saying "web2py error". 

 When I look at the file info for the web2py.app file it says Version 
 2.4.7, dated 29 May, 2013


 What am I doing wrong? 

 The app file info certainly doesn't look encouraging. 

 I assume having 2 versions of web2py in separate sub-trees shouldn't be 
 a problem


 Thanks,

 Jim




-- 
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] embed a pdf

2018-02-25 Thread Marco Mansilla
Take a look to this

https://groups.google.com/forum/m/#!topic/web2py/qgmh5C0XXkY

El 26 feb. 2018 03:36, "Martin Weissenboeck" <mweis...@gmail.com> escribió:

> Sorry, it does not work.
> The same results with or without "default"
>
> 2018-02-26 4:20 GMT+01:00 Marco Mansilla <thebigsho...@gmail.com>:
>
>> This
>>
>> download = URL("download", args=p.pdf)
>>
>> Should be
>>
>> download = URL("default", "download", args=p.pdf)
>>
>> You can do that on the view. But the change on the controller should do.
>>
>> El 25 feb. 2018 15:54, "Martin Weissenboeck" <mweis...@gmail.com>
>> escribió:
>>
>> What I want to do:
>>
>> I store a pdf-file in a database table.
>> Then I want to show this file.
>>
>> The model:
>>
>> db.define_table("pdfs",
>> Field("pdf", "upload", uploadfield="pdfdata"),
>> Field("description", "text"),
>> Field("pdfdata","blob")
>> )
>>
>>
>>
>> The controller:
>>
>> def showpdf():
>> id = int(request.args[0])
>> p=db.pdfs(id)
>> download = URL("download", args=p.pdf)
>> return dict(p=p, download=download)
>>
>>
>>
>> The view:
>>
>> {{extend 'layout.html'}}
>> Description: {{=p.description}}
>> 
>> 
>> 
>> Cannot display embed
>> 
>> 
>> 
>> 
>> 
>> Cannot display iframe
>> 
>> 
>>
>>
>>
>> ​The  section show an error "Error on loading pdf".
>>
>> The  section shows an empty iframe and opens the Adobe Acrobat
>> Reader with the required pdf.
>>
>> Any ideas?
>>
>> Regards Martin
>>
>> --
>> 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.
>>
>
>
> --
> 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] embed a pdf

2018-02-25 Thread Marco Mansilla
This

download = URL("download", args=p.pdf)

Should be

download = URL("default", "download", args=p.pdf)

You can do that on the view. But the change on the controller should do.

El 25 feb. 2018 15:54, "Martin Weissenboeck"  escribió:

What I want to do:

I store a pdf-file in a database table.
Then I want to show this file.

The model:

db.define_table("pdfs",
Field("pdf", "upload", uploadfield="pdfdata"),
Field("description", "text"),
Field("pdfdata","blob")
)



The controller:

def showpdf():
id = int(request.args[0])
p=db.pdfs(id)
download = URL("download", args=p.pdf)
return dict(p=p, download=download)



The view:

{{extend 'layout.html'}}
Description: {{=p.description}}



Cannot display embed





Cannot display iframe





​The  section show an error "Error on loading pdf".

The  section shows an empty iframe and opens the Adobe Acrobat
Reader with the required pdf.

Any ideas?

Regards Martin

-- 
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] Asobe Flash End of Life in 2020

2018-02-24 Thread Marco Mansilla
Would you please send those references?, Never saw that kind of stuff in
web2py docs of in users questions.

El 14 feb. 2018 19:11, "Bryan Nahrwold"  escribió:

I see references to Flash in some of the articles or book references for
Web2py.  Does Web2py have a dependence or Adobe Flash? If so, what is the
Roadmap to get off of that dependency by 2020?

-- 
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] Re: About Rest API uploads (again)

2018-02-18 Thread Marco Mansilla
Ok, so this is working right now, and most of errors were mine.

1. The error about cgi.py was related to wrong headers in axios request,
and the need to use backticks to use correctly parameters in the url, so
NOT web2py related

2.  Missed some details on FormData() docs, and did things wrong.

I'll try to make a small guide and simple sample app to show how easy is to
make it work, actually  Web2py, VueJS and Axios play along really well.

Sorry to bother everyone with this.

2018-02-18 22:36 GMT-03:00 Marco Mansilla <thebigsho...@gmail.com>:

> My bad, was a typho, still does't work.
>
> In another thread read something related to file submission was a
> functionality of SQLFORM, and I'm using forms with Vue components.
>
> As I said before, params inside formData are correct, and everything is
> processed ok by the server except files.
>
> El 18 feb. 2018 8:41 AM, "Val K" <valq7...@gmail.com> escribió:
>
>>  it should be:
>> var image = event.target.files[0];  //not just `event.target[0]`;
>>
>>
>>
>> On Sunday, February 18, 2018 at 12:09:46 AM UTC+3, marco mansilla wrote:
>>>
>>> Yes, got it. I hace something like:
>>>
>>>
>>> var image = event.target[0];
>>> formData.append('name', image.name);
>>> formData.append('myfile', image);
>>>  axios.post('../services/api/uploads', formData).then(...).catch(...);
>>>
>>> Params are correctly passed to the server, but files are not uploaded.
>>>
>>> El 16 feb. 2018 22:36, "Val K" <valq...@gmail.com> escribió:
>>>
>>>> Are you trying  to insert formData in something another? I believe,
>>>> that  formData should be passed to axios as is:
>>>>  axios.post('../services/api/uploadimg', formData)
>>>>
>>>> if you need to add some fields just do it:
>>>>  formData.append('name', 'blah')
>>>>
>>>>
>>>>
>>>>
>>>> On Monday, February 5, 2018 at 7:16:04 AM UTC+3, marco mansilla wrote:
>>>>>
>>>>> Hi everyone, this is something that has been asked several times and
>>>>> still there's no specific solution.
>>>>>
>>>>> I need to upload files by using a Rest API, so far I know we have nice
>>>>> ways to implement our apps in web2py
>>>>>
>>>>> http://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py
>>>>> is one way, simple and clean.
>>>>>
>>>>> the other one is
>>>>>
>>>>> http://experts4solutions.com/collection2/default/examples
>>>>>
>>>>> both work perfectly fine wiith regular form data, as it comes with
>>>>> uploads they dont.
>>>>>
>>>>> following the recipe from Bruno I can upload files by using curl like
>>>>> this
>>>>>
>>>>> curl POST -F "name=myfile" -F "image=@/home/user/myimgfile.png"
>>>>> http://127.0.0.1:8000/myapp/services/api/uploadimg
>>>>>
>>>>> and it works.
>>>>>
>>>>> In this new project I need to upload several images and some other
>>>>> format files (csv, doc, pdf, xls), as now I'm working with Vue.js and 
>>>>> Axios
>>>>> it would be awesome (and somehow faster) applying it.
>>>>>
>>>>> when I try to send the request using axios in this way
>>>>>
>>>>>let img=e.target.files;
>>>>>let formData = new FormData();
>>>>>
>>>>>formData.append('file', img[0]);
>>>>>axios.post('../services/api/uploadimg',{
>>>>> name:'test from axios',
>>>>> image:formData
>>>>> }, { headers: { 'Content-Type': 'multipart/form-data' } })
>>>>> .then((response)=>{console.log('file uploaded');})
>>>>> .catch((error)=>{console.log(error);});
>>>>> }
>>>>>
>>>>> server returns an error
>>>>>
>>>>> Traceback (most recent call last):
>>>>>   File "/home/user/web2py/gluon/restricted.py", line 219, in restricted
>>>>> exec(ccode, environment)
>>>>>   File "/home/user/web2py/applications/myapp/controllers/services.py", 
>>>>> line 50, in 
>>>>>   File "/home/user/web2py/gluon/globals.py", line 414, in 
>>>>> self

Re: [web2py] Re: About Rest API uploads (again)

2018-02-18 Thread Marco Mansilla
My bad, was a typho, still does't work.

In another thread read something related to file submission was a
functionality of SQLFORM, and I'm using forms with Vue components.

As I said before, params inside formData are correct, and everything is
processed ok by the server except files.

El 18 feb. 2018 8:41 AM, "Val K" <valq7...@gmail.com> escribió:

>  it should be:
> var image = event.target.files[0];  //not just `event.target[0]`;
>
>
>
> On Sunday, February 18, 2018 at 12:09:46 AM UTC+3, marco mansilla wrote:
>>
>> Yes, got it. I hace something like:
>>
>>
>> var image = event.target[0];
>> formData.append('name', image.name);
>> formData.append('myfile', image);
>>  axios.post('../services/api/uploads', formData).then(...).catch(...);
>>
>> Params are correctly passed to the server, but files are not uploaded.
>>
>> El 16 feb. 2018 22:36, "Val K" <valq...@gmail.com> escribió:
>>
>>> Are you trying  to insert formData in something another? I believe, that
>>>  formData should be passed to axios as is:
>>>  axios.post('../services/api/uploadimg', formData)
>>>
>>> if you need to add some fields just do it:
>>>  formData.append('name', 'blah')
>>>
>>>
>>>
>>>
>>> On Monday, February 5, 2018 at 7:16:04 AM UTC+3, marco mansilla wrote:
>>>>
>>>> Hi everyone, this is something that has been asked several times and
>>>> still there's no specific solution.
>>>>
>>>> I need to upload files by using a Rest API, so far I know we have nice
>>>> ways to implement our apps in web2py
>>>>
>>>> http://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py is
>>>> one way, simple and clean.
>>>>
>>>> the other one is
>>>>
>>>> http://experts4solutions.com/collection2/default/examples
>>>>
>>>> both work perfectly fine wiith regular form data, as it comes with
>>>> uploads they dont.
>>>>
>>>> following the recipe from Bruno I can upload files by using curl like
>>>> this
>>>>
>>>> curl POST -F "name=myfile" -F "image=@/home/user/myimgfile.png"
>>>> http://127.0.0.1:8000/myapp/services/api/uploadimg
>>>>
>>>> and it works.
>>>>
>>>> In this new project I need to upload several images and some other
>>>> format files (csv, doc, pdf, xls), as now I'm working with Vue.js and Axios
>>>> it would be awesome (and somehow faster) applying it.
>>>>
>>>> when I try to send the request using axios in this way
>>>>
>>>>let img=e.target.files;
>>>>let formData = new FormData();
>>>>
>>>>formData.append('file', img[0]);
>>>>axios.post('../services/api/uploadimg',{
>>>> name:'test from axios',
>>>> image:formData
>>>> }, { headers: { 'Content-Type': 'multipart/form-data' } })
>>>> .then((response)=>{console.log('file uploaded');})
>>>> .catch((error)=>{console.log(error);});
>>>> }
>>>>
>>>> server returns an error
>>>>
>>>> Traceback (most recent call last):
>>>>   File "/home/user/web2py/gluon/restricted.py", line 219, in restricted
>>>> exec(ccode, environment)
>>>>   File "/home/user/web2py/applications/myapp/controllers/services.py", 
>>>> line 50, in 
>>>>   File "/home/user/web2py/gluon/globals.py", line 414, in 
>>>> self._caller = lambda f: f()
>>>>   File "/home/user/web2py/gluon/globals.py", line 377, in f
>>>> res = rest_action(*request.args, **request.vars)
>>>>   File "/home/user/web2py/gluon/globals.py", line 309, in vars
>>>> self.parse_all_vars()
>>>>   File "/home/user/web2py/gluon/globals.py", line 280, in parse_all_vars
>>>> for key, value in iteritems(self.post_vars):
>>>>   File "/home/user/web2py/gluon/globals.py", line 301, in post_vars
>>>> self.parse_post_vars()
>>>>   File "/home/user/web2py/gluon/globals.py", line 237, in parse_post_vars
>>>> dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
>>>>   File "/usr/lib/python2.7/cgi.py", line 507, in __init__
>>>> self.read_multi(environ, keep_blank_val

Re: [web2py] Re: About Rest API uploads (again)

2018-02-17 Thread Marco Mansilla
Yes, got it. I hace something like:


var image = event.target[0];
formData.append('name', image.name);
formData.append('myfile', image);
 axios.post('../services/api/uploads', formData).then(...).catch(...);

Params are correctly passed to the server, but files are not uploaded.

El 16 feb. 2018 22:36, "Val K" <valq7...@gmail.com> escribió:

> Are you trying  to insert formData in something another? I believe, that
>  formData should be passed to axios as is:
>  axios.post('../services/api/uploadimg', formData)
>
> if you need to add some fields just do it:
>  formData.append('name', 'blah')
>
>
>
>
> On Monday, February 5, 2018 at 7:16:04 AM UTC+3, marco mansilla wrote:
>>
>> Hi everyone, this is something that has been asked several times and
>> still there's no specific solution.
>>
>> I need to upload files by using a Rest API, so far I know we have nice
>> ways to implement our apps in web2py
>>
>> http://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py is
>> one way, simple and clean.
>>
>> the other one is
>>
>> http://experts4solutions.com/collection2/default/examples
>>
>> both work perfectly fine wiith regular form data, as it comes with
>> uploads they dont.
>>
>> following the recipe from Bruno I can upload files by using curl like this
>>
>> curl POST -F "name=myfile" -F "image=@/home/user/myimgfile.png"
>> http://127.0.0.1:8000/myapp/services/api/uploadimg
>>
>> and it works.
>>
>> In this new project I need to upload several images and some other format
>> files (csv, doc, pdf, xls), as now I'm working with Vue.js and Axios it
>> would be awesome (and somehow faster) applying it.
>>
>> when I try to send the request using axios in this way
>>
>>let img=e.target.files;
>>let formData = new FormData();
>>
>>formData.append('file', img[0]);
>>axios.post('../services/api/uploadimg',{
>> name:'test from axios',
>> image:formData
>> }, { headers: { 'Content-Type': 'multipart/form-data' } })
>> .then((response)=>{console.log('file uploaded');})
>> .catch((error)=>{console.log(error);});
>> }
>>
>> server returns an error
>>
>> Traceback (most recent call last):
>>   File "/home/user/web2py/gluon/restricted.py", line 219, in restricted
>> exec(ccode, environment)
>>   File "/home/user/web2py/applications/myapp/controllers/services.py", line 
>> 50, in 
>>   File "/home/user/web2py/gluon/globals.py", line 414, in 
>> self._caller = lambda f: f()
>>   File "/home/user/web2py/gluon/globals.py", line 377, in f
>> res = rest_action(*request.args, **request.vars)
>>   File "/home/user/web2py/gluon/globals.py", line 309, in vars
>> self.parse_all_vars()
>>   File "/home/user/web2py/gluon/globals.py", line 280, in parse_all_vars
>> for key, value in iteritems(self.post_vars):
>>   File "/home/user/web2py/gluon/globals.py", line 301, in post_vars
>> self.parse_post_vars()
>>   File "/home/user/web2py/gluon/globals.py", line 237, in parse_post_vars
>> dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
>>   File "/usr/lib/python2.7/cgi.py", line 507, in __init__
>> self.read_multi(environ, keep_blank_values, strict_parsing)
>>   File "/usr/lib/python2.7/cgi.py", line 621, in read_multi
>> raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,)
>> ValueError: Invalid boundary in multipart form: '
>>
>>
>> couln't find much on that error but an old post in this group from 2012
>>
>> https://groups.google.com/forum/#!topic/web2py/ixeUUWryZh0/discussion
>>
>> Any suggestions?, meanwhile I'm still trying to make it work.
>>
>> Greets.
>>
>> --
> 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] Re: About Rest API uploads (again)

2018-02-10 Thread Marco Mansilla
I'll try on apache and Nginx asap.

El 11 feb. 2018 01:46, "Marco Mansilla" <thebigsho...@gmail.com> escribió:

> Firefox, and same error pops on Chrome, I'm using the default development
> server included un web2py.
>
> For now I worked around this by storing images as blobs.
>
> El 11 feb. 2018 01:43, "Massimo Di Pierro" <massimo.dipie...@gmail.com>
> escribió:
>
>> what's cgi.py? What web server are you using?
>>
>> On Sunday, 4 February 2018 22:16:04 UTC-6, marco mansilla wrote:
>>>
>>> Hi everyone, this is something that has been asked several times and
>>> still there's no specific solution.
>>>
>>> I need to upload files by using a Rest API, so far I know we have nice
>>> ways to implement our apps in web2py
>>>
>>> http://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py is
>>> one way, simple and clean.
>>>
>>> the other one is
>>>
>>> http://experts4solutions.com/collection2/default/examples
>>>
>>> both work perfectly fine wiith regular form data, as it comes with
>>> uploads they dont.
>>>
>>> following the recipe from Bruno I can upload files by using curl like
>>> this
>>>
>>> curl POST -F "name=myfile" -F "image=@/home/user/myimgfile.png"
>>> http://127.0.0.1:8000/myapp/services/api/uploadimg
>>>
>>> and it works.
>>>
>>> In this new project I need to upload several images and some other
>>> format files (csv, doc, pdf, xls), as now I'm working with Vue.js and Axios
>>> it would be awesome (and somehow faster) applying it.
>>>
>>> when I try to send the request using axios in this way
>>>
>>>let img=e.target.files;
>>>let formData = new FormData();
>>>
>>>formData.append('file', img[0]);
>>>axios.post('../services/api/uploadimg',{
>>> name:'test from axios',
>>> image:formData
>>> }, { headers: { 'Content-Type': 'multipart/form-data' } })
>>> .then((response)=>{console.log('file uploaded');})
>>> .catch((error)=>{console.log(error);});
>>> }
>>>
>>> server returns an error
>>>
>>> Traceback (most recent call last):
>>>   File "/home/user/web2py/gluon/restricted.py", line 219, in restricted
>>> exec(ccode, environment)
>>>   File "/home/user/web2py/applications/myapp/controllers/services.py", line 
>>> 50, in 
>>>   File "/home/user/web2py/gluon/globals.py", line 414, in 
>>> self._caller = lambda f: f()
>>>   File "/home/user/web2py/gluon/globals.py", line 377, in f
>>> res = rest_action(*request.args, **request.vars)
>>>   File "/home/user/web2py/gluon/globals.py", line 309, in vars
>>> self.parse_all_vars()
>>>   File "/home/user/web2py/gluon/globals.py", line 280, in parse_all_vars
>>> for key, value in iteritems(self.post_vars):
>>>   File "/home/user/web2py/gluon/globals.py", line 301, in post_vars
>>> self.parse_post_vars()
>>>   File "/home/user/web2py/gluon/globals.py", line 237, in parse_post_vars
>>> dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
>>>   File "/usr/lib/python2.7/cgi.py", line 507, in __init__
>>> self.read_multi(environ, keep_blank_values, strict_parsing)
>>>   File "/usr/lib/python2.7/cgi.py", line 621, in read_multi
>>> raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,)
>>> ValueError: Invalid boundary in multipart form: '
>>>
>>>
>>> couln't find much on that error but an old post in this group from 2012
>>>
>>> https://groups.google.com/forum/#!topic/web2py/ixeUUWryZh0/discussion
>>>
>>> Any suggestions?, meanwhile I'm still trying to make it work.
>>>
>>> Greets.
>>>
>>> --
>> 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] Re: About Rest API uploads (again)

2018-02-10 Thread Marco Mansilla
Firefox, and same error pops on Chrome, I'm using the default development
server included un web2py.

For now I worked around this by storing images as blobs.

El 11 feb. 2018 01:43, "Massimo Di Pierro" <massimo.dipie...@gmail.com>
escribió:

> what's cgi.py? What web server are you using?
>
> On Sunday, 4 February 2018 22:16:04 UTC-6, marco mansilla wrote:
>>
>> Hi everyone, this is something that has been asked several times and
>> still there's no specific solution.
>>
>> I need to upload files by using a Rest API, so far I know we have nice
>> ways to implement our apps in web2py
>>
>> http://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py is
>> one way, simple and clean.
>>
>> the other one is
>>
>> http://experts4solutions.com/collection2/default/examples
>>
>> both work perfectly fine wiith regular form data, as it comes with
>> uploads they dont.
>>
>> following the recipe from Bruno I can upload files by using curl like this
>>
>> curl POST -F "name=myfile" -F "image=@/home/user/myimgfile.png"
>> http://127.0.0.1:8000/myapp/services/api/uploadimg
>>
>> and it works.
>>
>> In this new project I need to upload several images and some other format
>> files (csv, doc, pdf, xls), as now I'm working with Vue.js and Axios it
>> would be awesome (and somehow faster) applying it.
>>
>> when I try to send the request using axios in this way
>>
>>let img=e.target.files;
>>let formData = new FormData();
>>
>>formData.append('file', img[0]);
>>axios.post('../services/api/uploadimg',{
>> name:'test from axios',
>> image:formData
>> }, { headers: { 'Content-Type': 'multipart/form-data' } })
>> .then((response)=>{console.log('file uploaded');})
>> .catch((error)=>{console.log(error);});
>> }
>>
>> server returns an error
>>
>> Traceback (most recent call last):
>>   File "/home/user/web2py/gluon/restricted.py", line 219, in restricted
>> exec(ccode, environment)
>>   File "/home/user/web2py/applications/myapp/controllers/services.py", line 
>> 50, in 
>>   File "/home/user/web2py/gluon/globals.py", line 414, in 
>> self._caller = lambda f: f()
>>   File "/home/user/web2py/gluon/globals.py", line 377, in f
>> res = rest_action(*request.args, **request.vars)
>>   File "/home/user/web2py/gluon/globals.py", line 309, in vars
>> self.parse_all_vars()
>>   File "/home/user/web2py/gluon/globals.py", line 280, in parse_all_vars
>> for key, value in iteritems(self.post_vars):
>>   File "/home/user/web2py/gluon/globals.py", line 301, in post_vars
>> self.parse_post_vars()
>>   File "/home/user/web2py/gluon/globals.py", line 237, in parse_post_vars
>> dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
>>   File "/usr/lib/python2.7/cgi.py", line 507, in __init__
>> self.read_multi(environ, keep_blank_values, strict_parsing)
>>   File "/usr/lib/python2.7/cgi.py", line 621, in read_multi
>> raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,)
>> ValueError: Invalid boundary in multipart form: '
>>
>>
>> couln't find much on that error but an old post in this group from 2012
>>
>> https://groups.google.com/forum/#!topic/web2py/ixeUUWryZh0/discussion
>>
>> Any suggestions?, meanwhile I'm still trying to make it work.
>>
>> Greets.
>>
>> --
> 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] Upload an image from front-end

2018-02-05 Thread Marco Mansilla
I'm looking for a similar solution, but the front-end is written in VueJs,
and Axios for POST and GET requests, since I couldn'd find a way to send
the actual file to the server I'm going with a solution close to your
second option, has some extra steps but it's clean and somehow more verbose
for multiple uploads, loading notifications and progress tracker.

2018-02-05 18:48 GMT-03:00 Πέτρος Χατζηλάμπρος :

> Dear all,
> in my last project I am using the following architecture:
>
>-  Web2py is used only at the back-end.
>- The front-end is developed using React by an other developer.
>- The front end sends GET and POST requests to web2py and web2py
>responds with json.
>
> Using this architecture what is the best way to send and store an image
> from the browser to the web2py ? I am thinking to use one of the three
> following methods:
>
>- use a web2py controller to create a form with an upload field, sent
>the hidden form inputs(_formkey and _formname) to front-end and then the
>front-end will use javascript to imitate the behavior of the browser
>- The front-end will use javascript to convert the file to base64
>format and it will send it with a POST request to web2py. Then web2py will
>convert the base64 string into a file and it will save it  to folder
>/uploads using a controller
>
> Which method you think that fits better to web2py ?
>
> --
> 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.
>



-- 
-BEGIN GEEK CODE BLOCK-
version 3.1
GCS/GTW/| d? s+:+>+++ a-- C+++(+) UL>$ P++>+++ L+++>+$ E->+ W++>+
N>+++ o K- w---()
O(--) M>-- V-- PS++ PE++>+ Y-->+ PGP+>+++ t-(?) 5? X++ R+ !tv b+++>
DI+++ D--- G+++>+
e+++> h* r++>+++ y++
--END GEEK CODE BLOCK--

-- 
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.


[web2py] About Rest API uploads (again)

2018-02-04 Thread marco mansilla
Hi everyone, this is something that has been asked several times and still 
there's no specific solution.

I need to upload files by using a Rest API, so far I know we have nice ways 
to implement our apps in web2py

http://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py is one 
way, simple and clean.

the other one is 

http://experts4solutions.com/collection2/default/examples

both work perfectly fine wiith regular form data, as it comes with uploads 
they dont.

following the recipe from Bruno I can upload files by using curl like this

curl POST -F "name=myfile" -F "image=@/home/user/myimgfile.png" 
http://127.0.0.1:8000/myapp/services/api/uploadimg

and it works.

In this new project I need to upload several images and some other format 
files (csv, doc, pdf, xls), as now I'm working with Vue.js and Axios it 
would be awesome (and somehow faster) applying it.

when I try to send the request using axios in this way

   let img=e.target.files;
   let formData = new FormData();

   formData.append('file', img[0]);
   axios.post('../services/api/uploadimg',{
name:'test from axios',
image:formData
}, { headers: { 'Content-Type': 'multipart/form-data' } })
.then((response)=>{console.log('file uploaded');})
.catch((error)=>{console.log(error);});
}

server returns an error

Traceback (most recent call last):
  File "/home/user/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
  File "/home/user/web2py/applications/myapp/controllers/services.py", line 50, 
in 
  File "/home/user/web2py/gluon/globals.py", line 414, in 
self._caller = lambda f: f()
  File "/home/user/web2py/gluon/globals.py", line 377, in f
res = rest_action(*request.args, **request.vars)
  File "/home/user/web2py/gluon/globals.py", line 309, in vars
self.parse_all_vars()
  File "/home/user/web2py/gluon/globals.py", line 280, in parse_all_vars
for key, value in iteritems(self.post_vars):
  File "/home/user/web2py/gluon/globals.py", line 301, in post_vars
self.parse_post_vars()
  File "/home/user/web2py/gluon/globals.py", line 237, in parse_post_vars
dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
  File "/usr/lib/python2.7/cgi.py", line 507, in __init__
self.read_multi(environ, keep_blank_values, strict_parsing)
  File "/usr/lib/python2.7/cgi.py", line 621, in read_multi
raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,)
ValueError: Invalid boundary in multipart form: '


couln't find much on that error but an old post in this group from 2012

https://groups.google.com/forum/#!topic/web2py/ixeUUWryZh0/discussion

Any suggestions?, meanwhile I'm still trying to make it work.

Greets.

-- 
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] POST api return 405

2018-02-01 Thread Marco Mansilla
What's the responde of Chrome Dev tools or firebug?, Could you show usted
the API definition?.

As César says, we need some code to provide an accurate solution proposal

El 1 feb. 2018 16:04, "yogeshwar khalkar" 
escribió:

> I have POST api in web2py I am accessing it using angular httpclient post
> service but, it returns 405(method not allow) error.
>
> can anybody give me solution for it
>
> Thanks
>
> --
> 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.


[web2py] Js packages from browser

2017-12-10 Thread Marco Mansilla
Just found this, looks nice.

https://medium.com/@ericsimons/introducing-turbo-5x-faster-than-yarn-npm-and-runs-natively-in-browser-cc2c39715403

-- 
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] About Restful with web2py

2017-12-04 Thread Marco Mansilla
Please share the table definition in the model.

El dic. 2, 2017 16:27, "Enrique Acosta"  escribió:

> Hello from Cuba,
>
> I followed the guide at http://www.web2pyslices.
> com/slice/show/1533/restful-api-with-web2py but whe i try to make a post
> in the webservice curl show me a mistake:
>
> curl -d "f_entry=something" http://127.0.0.1:8000/RT/default/api/
> entries.json
>
> errorid
>
> The id is autoincrement but the value is an empty string.
>
> I will appreciate if anybody help me,
>
> Best regards, Enrique
>
> --
> 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.


[web2py] API Response workaround

2017-11-14 Thread Marco Mansilla
Hi, I'm working on a new project that requires a restful api service and 
found a problem.


Following the examples in the book and Bruno's example in web2py slices 
could successfully write an API service, also tried the APIMaker example 
from expert4solutions. In the second case didn't get validation so 
replaced insert and update with validate_and_insert and validate and 
update respectively.


Now I found out that when posting or updating data either it is correct 
or not server always returns 200 code and never a 404, so I have to 
watch for response.data.row.errors, is there a way to make it work as 
spected?


Thanks.

--
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.


[web2py] Feature request [?]

2017-03-06 Thread marco mansilla
Hi, I'm a long time web2py user and most of us. Latety I've been deep 
learning about useful js libraries and frameworks, I've worked a lot with 
jQuery and it just works fine, then went to test ractive, reactjs and 
angular, did some small stuff with the latest. But the issue most of the 
times has been with the delimiters, a long time ago read in some answer 
from Massimo that it would be ok to change {{  }} delimiters from web2py 
instead of the js framework, but sometimes it's confusing since there are 
different kind of delimiters, and doing it on every project having to 
update the default code in the templates is annoying.

Lately I've been learning VueJs and love it, small, functional, practical 
but has the same delimiters, and reading some docs and watching some videos 
found out that blade (template engine from laravel), has some nice features 
on this, before delimiters collide in the template it has the option to 
write something like:

@{{   foobar  }}

so the content inside those delimiters are ignored by the template engine, 
so no need to change delimiters, since blade also uses double curly braces, 
which makes it easy to play with others. Would be possible so implement 
something like this in future versions?.

Hope this no to be a dumb request.

Marco.

-- 
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] Selecting booleans from sqlite3 database

2017-01-09 Thread Marco Mansilla
El Mon, 9 Jan 2017 12:17:19 -0800 (PST)
LoveWeb2py  escribió:

> Hello,
> 
> 
> I'm trying to do a simple query against a sqlite3 database where the
> values are stored as 0's and 1's
> 
> All i want to do is select all values that are True or False
> 
> According to the book this should work:
> 
> db(db.table.field==True).select()
> 
> and that would return rows
> 
> however, it's returning Rows(0) (nothing)
> 
> I verified in the database that they are being stored as True/False
> through appadmin
> 
> Any thoughts on why this isn't working?
> 

Hi, this has been a headache to me in a new project, since I'm
re structuring the database and migrating data from an existing project
(some crazy thing some did in java), and booleans where 0's and 1's,
when I tried to run queries with these parameters didn't work, just
like in your case, then I realized that web2py queries are effective
with 'T' and 'F' for boolean values and now everything works.

So, is this the expected behaviour?, am I/are we missing something
about DAL?.

Just for the record, I'm not that smart, when imported backup from
table to db booleans were 0 and 1, but after editing the table in CSV
format and restoring data to table noticed the difference and booleand
were converted to T and F respectively.

Hope it helps.

Marco.

-- 
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] Re: About web2py_component and redirect

2016-11-10 Thread Marco Mansilla
What I did was add a 0 option to select, and the fire a js event with
modal, using $.web2py.component works with a small issue, the first time it
fires opens and closes a new tab.

I will try to share it tonight, maybe someone else could find it useful.

El 10 nov. 2016 4:26 AM, "黄祥"  escribió:

i think you can use comment for that, n modify the css class to your own
css (assuming you have your own css)
e.g.
db.test.user.comment = A(_class="glyphicon glyphicon-plus-sign",
**{"_data-toggle":"modal", "_data-target":"#modal_auth_user"} ) if
has_membership_admin else None

best regards,
stifan

-- 
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] Re: About web2py_component and redirect

2016-11-09 Thread Marco Mansilla
El Wed, 9 Nov 2016 15:45:55 -0800 (PST)
黄祥  escribió:

> *pls try :*
> *controllers/default.py*
> def modal_auth_user():
> table = db.auth_user
> fields = None
> target_response = '(function($) 
> {$("#modal_auth_user").modal("hide");}(jQuery));'
> form = SQLFORM(table, fields = fields)
> if form.process(formname = 'form_modal').accepted:
> response.js = target_response
> redirect(request.env.http_web2py_component_location, client_side =
> True) elif form.errors:
> response.flash = 'form has errors'
> return dict(form = form)
> 
> *views/default/index.html*
> {{extend 'layout.html'}}
> 
> {{=H3(T('Test'), _class = 'text-info') }}
> 
> {{=LOAD('default', 'test.load', ajax = True, 
> target = 'test') }}
> 
> *views/default/test.load*
> {{=form}}
> 
>  role="dialog" aria-labelledby="myModalLabel">
> 
> 
> 
>  aria-label="Close">
> {{=DIV(T('User') ) }}
> 
> 
> {{=LOAD('default', 'modal_auth_user.load', ajax = True) }}
> 
> 
> 
> 
> 
> best regards,
> stifan
> 

Thank you both, everything seems to work nice now, so next step would
be create a plugin/widget to add a + button next to item list field. I
think there was a plugin, documented on web2py slices but last time I
tried didn't work for compatibility issues, so will do that by myself.

Thanks for the help, and sorry for the lazy question.

Marco.

-- 
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] Re: About web2py_component and redirect

2016-11-09 Thread Marco Mansilla
Would please provide minimal examples?... for some reason in controller:

return "jQuery(('.modal').modal('hide'))"

shows the line as text inside .modal-body.

Thanks in advance.

2016-11-09 13:15 GMT-03:00 Anthony :

> So, fixed it partially with web2py_component in the view, the web2py
>> component calls the form in the modal-body, and a few lines of js
>> toggle the modal, in this case the info is submited, but the modal
>> doesn't close and I would like to know if there's some way to catch the
>> web2py_component after de post event.
>>
>
> In the controller that handles the form submission, you could use
> response.js to return some Javascript code, which will be evaluated by the
> browser when the response is received. Alternatively, you could just add
> your own event handler in the browser to react to the form submission.
>
> Anthony
>
> --
> 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.
>



-- 
-BEGIN GEEK CODE BLOCK-
version 3.1
GCS/GTW/| d? s+:+>+++ a-- C+++(+) UL>$ P++>+++ L+++>+$ E->+ W++>+
N>+++ o K- w---()
O(--) M>-- V-- PS++ PE++>+ Y-->+ PGP+>+++ t-(?) 5? X++ R+ !tv b+++>
DI+++ D--- G+++>+
e+++> h* r++>+++ y++
--END GEEK CODE BLOCK--

-- 
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.


[web2py] About web2py_component and redirect

2016-11-08 Thread Marco Mansilla
Hi, since my previous email hasn't got any response, I'm still trying
to find a solution to my problem.

The problem is this, I have a form loaded via ajax into a modal, so
far, so good, it gets called for creating a new form as well as
edition, with SQLFORM in the respective controller, but when I fill the
data for new record or modify existing records, data never gets to the
database.

So, fixed it partially with web2py_component in the view, the web2py
component calls the form in the modal-body, and a few lines of js
toggle the modal, in this case the info is submited, but the modal
doesn't close and I would like to know if there's some way to catch the
web2py_component after de post event.

My bad previous email wasn't specifically web2py, but since I'm trying
to find out a solution with a web2py component I would really
appreciate some help.

PS: I'm calling web2py_component like this

  

thanks in advance.

-- 
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.


[web2py] load form in modal via ajax not submitting

2016-11-04 Thread Marco Mansilla
Hi, it's been a long time and now I have this really odd issue, I have
a model like this:

models/db_01.py

db.define_table('dogs',
Field('name'),
Field('owner'),
Field('age'),
Field('adress'))

In my view generate a grid, which has a lot of dogs, and each one had a
modal to view details/edit, but as the table gets bigger page loading
gets slower since it has to generate all the modals, one solution I
came up with is creating only one modal and attach the view button to a
jquery event and load the form in the modal, so mi controller goes like
this:

controllers/app.py

# list of all the dogs
def index():
list=db(db.dogs.id>0).select()

return dict(list=list)

def dogDetails():

id = request.args(0)

if id:
# if id provided returns an update form
 form=SQLFORM(db.dogs, id)

if form.process().accepted:
session.flash='it works!'
elif form.errors:
session.flash= 'not working'
else:
# if not id, creates a new record
form=SQLFORM(db.dogs)
if form.process(formname=None).accepted:
session.flash='it works!'
elif form.errors:
session.flash= 'Something broken'

return dict(form=form)

so, views look like this:

app/index.html

{{extend 'layout.html'}}


  
Complete list

 New dog


  

  Name
  Owner
  Age
  Edit

  
  
{{for dog in list:}}

  {{=dog.name}}
  {{=dog.owner}}
  {{=dog.age}}
{{pass}}
  

  




  

  


  
  



  

  


and app/dogDetails.load

{{=form}}

So, everything gets glued with some javascript and jquery code that
looks like this, nothing fancy but partially works:

$(document).ready(function(){
  $('.callForm').on('click', function(){
// get the id of current element
var id = $(this).attr('id');

// if element gets a edit record, else shows an empty form for new
record
if (id != undefined){
  $('.modal-body').load('dogDetails.load/'+id, function(){
$('.modal-title').text('Edit record');
  })
}else{
  $('.modal-body').load('dogDetails.load', function(){
$('.modal-title').text('New record');
  })
}
$('.modal').modal('toggle');

  })
})

so far it shows forms and everything, but it is not submitting either
new records or even updates, no error. Maybe I'm missing something
really obvious but can't find out what.

Thanks in advance for taking the time to read this long problem...

-- 
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] Best way to start new project?

2016-10-18 Thread Marco Mansilla
I'm used to:

$python web2py.py -S newapp

There are very few things I do outside the console, so this method feels
comfortable.

El 18 oct. 2016 6:34 PM, "pbreit"  escribió:

> What's the best way to start a new project? I'd specifically like
> something as plain as possible.
>
> There are at least 3 "official" options: copy/past welcome, new simple app
> in admin, new app wizard in admin.
>
> Are there any "starters" on github or anything that people recommend?
>
> --
> 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] Re: Ask Web2py Groups: Has anyone here used web2py with JQuery Mobile?

2015-10-23 Thread Marco Mansilla
El Wed, 21 Oct 2015 11:38:56 -0700 (PDT)
Julieta Abdala  escribió:

> How I can load Layout.html or plugin_jqmobile/layout.html according
> with the client?
> 
> I need to do 2 applications? One for pc and other for mobile?
> 
> Thanks
> 
> El sábado, 17 de septiembre de 2011, 10:45:19 (UTC-3), Pystar
> escribió:
> >
> > I would like to know if anyone here has  used web2py with JQuery 
> > Mobile? And what the experience was.  
> 

H... there are several ways to accomplish this, but basically you
could write some js that load either jquery or jquery_mobile based on
the device, also you could create two layouts and load them based on
the same events.

Take advantage of responsiveness of bootstrap or any other css
framework and load jquery, or both. There's no need of two apps, would
be a pain in the ass to maintain or even scale!.

Marco.

-- 
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] wsgi / apache error

2015-05-27 Thread Marco Mansilla
El Wed, 27 May 2015 14:37:43 +0200
Johann Spies johann.sp...@gmail.com escribió:

 Most parts of the app work on our server running apache2.4 and wsgi
 but on after a query which takes some time I get this in the apache
 error log and 504 Gateway Timeout on my browser:
 
 [Wed May 27 14:20:46.617759 2015] [wsgi:error] [pid 18286:tid
 140225013630720] [remote x.x.x.x:10678] mod_wsgi (pid=18286):
 Exception occurred processing WSGI script
 '/home/www-data/web2py/wsgihandler.py'. [Wed May 27 14:20:46.617850
 2015] [wsgi:error] [pid 18286:tid 140225013630720] [remote
 x.x.x.x:10678] IOError: failed to write data
 
 Now my question: where did wsgi try to write data?
 
 Regards
 Johann
 

Check permissions of applications/[your-app], I think that's the only
place where wsgi should write something.

Something like this happened when I moved an app to a git repo and
pulled changes.

Marco.

-- 
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] Restricting Access to database based on roles at the Database level.

2015-05-14 Thread Marco Mansilla
El Thu, 14 May 2015 09:58:14 +
Jason (spot) Brower encomp...@gmail.com escribió:

 I am building a database that needs to be very secure for all those
 just in case situations.
 I want to restrict the database access based on roles that I setup.
 Does web2py even have this functionality or is this something I have
 to do with SQLAlchemy or something?
 BR,
 Jason Brower
 

You should check documentation about auth.has_permission and
auth.has_membership, that should work straight forward by checking the
current session's user to apply rules.

Marco.

-- 
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.


Fw: [web2py] Compute expiry date

2015-04-02 Thread Marco Mansilla
El Thu, 2 Apr 2015 06:46:30 -0700 (PDT)
Annet anneve...@googlemail.com escribió:

 I a table I defined the following field:
 
 Field('expiryDate', type='date', 
 requires=IS_EMPTY_OR(IS_DATE(format='%d-%m-%Y'))
 
 By default the expiryDate is set to request.now, since there's no
 need to monthly update
 the expiry date, I want to calculate it when the user actually
 updates or cancels his account.
 
 So if expiryDate is set to 28-11-2014 and the user updates his
 account on 6-04-2015, the
 expiryDate is 28-04-2015, and when the user updates his account on 
 30-04-2015, the
 expiryDate is 28-05-2015
 
 I had a look at relativedelta to solve this problem, but I wonder
 whether there is an easier
 way to solve this problem within web2py.
 
 
 Kind regards,
 
 Annet
 
Could you show or tell if there are more tables related to the one you
want to work expirations in?. I can only think in a updates table
related to users and expirations, so when an update occurs this should
trigger a function that works on expirations table.

I'll try to elaborate an example.

Marco.

-- 
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.


[web2py] Feature or widget required...[?]

2015-03-22 Thread Marco Mansilla
Hi, a long time ago I was looking for some feature that allow to add an
extra button next to dropdown list elements to options for list related
to other tables, something like django admin does [0], eventually I
found this recipe in web2pyslices widget-select-or-add-option[1] and a
new version[2], and used to work, I have it implemented in two pretty
old apps, but now I tried to do the same on the current version of
web2py, I gues somewhere in the middle it might broken some
compatibility with boostrap, jQuery or jQuery UI.

Would it be possible for the developers team to take a look and check
if it would be possible to add this a default feature of web2py out of
the box as they do the already many wonders that already come with the
package?.

Marco.


[0] https://docs.djangoproject.com/en/1.7/_images/admin10.png

[1]
http://www.web2pyslices.com/slice/show/1446/widget-select-or-add-option

[2]
http://www.web2pyslices.com/slice/show/1616/widget-select-or-add-option-ng

Also came across an issue similar to the one I'm having now, but it was
with an older version of web2py.

[3] https://groups.google.com/forum/#!topic/web2py/rsVcWlO2fLg

-- 
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] Re: internal error: [Errno 1] Operation not permitted when attempting Pack All

2015-03-17 Thread Marco Mansilla
El Tue, 17 Mar 2015 19:38:07 -0700 (PDT)
LoveWeb2py atayloru...@gmail.com escribió:

 Check your file permissions. Are you using windows or linux? 
 
 On Tuesday, March 17, 2015 at 8:17:46 PM UTC-4, Tom Campbell wrote:
 
  Attempting to do a Manage  Pack All on a project but I get this
  message:
 
  messageinternal error: [Errno 1] Operation not permitted: 
 
  I am attempting to save to the Dropbox directory in which web2py
  lives. What should to do to get it to pack correctly?
 
 

Actually you should check your folder permissions, since that seems to
be complaining about.

-- 
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.


[web2py] Question about requirements!

2015-01-28 Thread Marco Mansilla
Hello, I've been using a not so NEW version of web2py, maybe 2.8 or
something, that I've cloned from github a long time ago, so today came
to my mind to checkout  what's new and found out that seems to be new
requirements in order to work, so it may be not that portable anymore.

When I did: 

$python web2py -a password

as usual, it complained pyDAL wasn't found, and after installing it from
pypi tried again it complained about pyodbc and only after installing
both web2py started working.

I would like to know if this is the intended behaviour, since in a very
short period I would like to upgrade web2py in two servers and I'm not
sure how good it's gonna come out.

Thanks in advance.

Marco.

PS: I'm running Debian GNU/Linux

-- 
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] database select from set encoding

2014-12-29 Thread Marco Mansilla
El Mon, 29 Dec 2014 05:53:37 -0800 (PST)
Yebach vid.og...@gmail.com escribió:

 hello
 
 I have a postgres dabatabase with utf8 encoding 
 
 after executing 
 workersDb = db(db.worker.w_organisation == org).select(db.worker.id, 
 db.worker.w_nick_name).as_list()
 
 I get a list of dict where my strings are endoed as 
 
 'Moj\xc4\x8dca'
 
 where it should write Mojčca
 
 How do i set the encoding?
 
 Thank you
 
 
right at the end of the section

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-strings--the-uri-parameter-

Marco.

-- 
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] Ways to manage db without ssh tunnel

2014-12-13 Thread Marco Mansilla
El Thu, 11 Dec 2014 18:37:01 -0800 (PST)
sergenikov sg.s...@gmail.com escribió:

 Hello web2py community,
 
 I recently hosted a website with hostgator shared hosting. The setup
 was ok, somewhat tricky, but ok. However, I found out too late that
 hostgator's shared hosting does not support ssh tunneling. I was
 wondering what would be suggestions for managing the db without this.
 I am mainly looking at giving the client functionality to fetch db
 contents and add/remove stuff from db. Is this possible without a lot
 of python scripting or am I screwed to write a lot of python code for
 this?
 
 Note: I know there is an option to disable security, but that seems
 too risky. Not sure I want to do that unless someone has a suggestion
 how to do it in a hacky way.
 
 Thank you in advance, community.
 

First thing that comes to my mind is SQLFORM.grid or SQLFORM.smartgrid,
this and RBAC should be enough for an app db administration over the
web, not much hacky or complex to rely on ssh.

hope it helps.

Marco.

-- 
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] Re: create web2py application with 2 database

2014-10-09 Thread Marco Mansilla
El Wed, 8 Oct 2014 19:50:37 -0700 (PDT)
Anthony abasta...@gmail.com escribió:

 
 
  1 for fake data (tax reporting to government)
 
 
 Hmm, not sure I want to answer this one...
 

it would be propper to rephrase that... to maybe... backup data?, or
auxiliar information and definitely exclude the whole government
part...

** back to sleep **

Marco.

-- 
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] Re: Creating a mobile friendly site -- How?

2014-07-27 Thread Marco Mansilla
I guess you could check if the browser is mobile or not, and based on
that apply a different css style to the site.

Still it would be easier go with Massimo's suggestion.

Marco.

 Thanks, Massimo. I'll give that a try. Would it be possible to just
 have a mobile site and redirect the user based on their agent string?
 
 
 On Sun, Jul 27, 2014 at 12:00 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:
 
  It looks horrible about of the CSS that you use. Your divs have a
  fixed width and are not fluid. try rewrite it using twitter
  bootstrap or semantic-ui.
 
 
  On Sunday, 27 July 2014 10:34:17 UTC-5, LoveWeb2py wrote:
 
  Hello everyone,
 
  I'm working on www.handymancharles.com
 
  I'm using web2py for the site and I really love it! When I try to
  access the site on my mobile phone it looks horrible though. I
  know that if I create a default web2py app it is ready for mobile
  devices, but how could I make this current site mobile ready? What
  changes would I need to make or what is the best practice? Should
  I do something like check the user agent and then create a totally
  separate site for mobile devices? I'm lost and as always
  appreciate any advice!
 
   --
  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 a topic in
  the Google Groups web2py-users group.
  To unsubscribe from this topic, visit
  https://groups.google.com/d/topic/web2py/qwuRtlByMwQ/unsubscribe.
  To unsubscribe from this group and all its topics, 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] bootstrap readonly

2014-07-02 Thread Marco Mansilla
El Wed, 2 Jul 2014 11:46:18 -0700 (PDT)
Annet anneve...@googlemail.com escribió:

 Bootstrap has the following option to render a field read only:
 
 input class=form-control type=text placeholder=Readonly input
 here… readonly
 
 Is ther a way to add readonly to input?
 
 
 Regards,
 
 Annet
 


Have you tried:

   db.my_table.my_field.writable=False

or:

   setting with jquery $(#field_id).attr('readonly',true) 


I have noticed that if I need to change some field value's using
javascript, setting writable to false in fiel definition throws
tickets, and solved with jquery option...


hope it helps.

Marco.

-- 
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] can we make e-commerce web portal in web2py with multiple hits and users.

2014-07-01 Thread Marco Mansilla
El Tue, 1 Jul 2014 02:15:17 -0700 (PDT)
kanchan s.kanchan2...@gmail.com escribió:

 we have to develop a complete E-commerce software with payment
 gateway also . In this software  more than 500 users will use it ,
 hit it simultaneously . So my query is that does web2py can handle
 multiple user easily , or will it decrease the software speed if we
 make it in web2py or any other issue will create in future with
 multiple users.
 

Nice question, for this case i have recently found an intering app by
Massimo that might be a good example to prevent performance decrease,
by handling session vars.

https://github.com/mdipierro/web2py-appliances/tree/master/EStore

take a look.

-- 
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] Can I include wordpress plugin in web2py (e.g. woocommerce) ?

2014-06-14 Thread Marco Mansilla
El Sat, 14 Jun 2014 22:11:24 -0700 (PDT)
Sarbjit sarbjit1...@gmail.com escribió:

 Is it possible to include wordpress plugins in web2py? I want to use 
 woocommerce (link http://demo2.woothemes.com/?name=superstore)
 theme (look and feel for web2py app).
 
 I saw that http://www.nammuhats.com/ is listed as being developed
 using web2py but this site seems to be using woocommerce themes etc.
 
 Is it possible to integrate the front end side of woocommerce theme
 in web2py?
 

Basically you have to follow a few simple steps[0] to get this working,
shouln't be that hard with some work, and it should work with pretty
much any theme.

 Marco.

[0]http://www.web2pyslices.com/slice/show/1516/adapt-a-css-template-to-web2py-layouthtml

-- 
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] layout

2014-06-05 Thread Marco Mansilla
El Thu, 5 Jun 2014 09:21:32 -0700 (PDT)
Tom Russell tsrdatat...@gmail.com escribió:

 I want to use a few parts from a layout for web2py 
 here
 http://www.web2py.com/layouts/static/plugin_layouts/layouts/CorporateOffice/index.html
 
 Mainly I just want the div id=wrapper for my layout.html. I tried 
 adding this but it does not seem to work. Is there an easy way to do
 this?
 
 Thanks.
 

You must remember that wrapper is generic and from the current layout
it behaves based on the current CSS, so maybe woulbe be a good idea to
change the name and import the CSS from the layout you want to use.

Marco

-- 
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] How to change bootstrap theme of application ?

2014-05-31 Thread Marco Mansilla
El Sat, 31 May 2014 12:02:30 -0700 (PDT)
Neeraj Shukla neerajdshu...@gmail.com escribió:

 After replacing bootstrap.min.css located in static/css/ folder of 
 application with another bootstrap.min.css changes are not getting 
 reflected in application.
 
take a look here:

http://www.web2pyslices.com/slice/show/1516/adapt-a-css-template-to-web2py-layouthtml

also you should check the link references in views/layout.html

Marco.

-- 
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] How to import python functions

2014-05-22 Thread Marco Mansilla
El Wed, 21 May 2014 22:17:07 -0700 (PDT)
Maurice Waka mauricew...@gmail.com escribió:

 I have this example code in python module:
 
 def test():
 .code
 print('Message delivered')
 test()
 
 How do I import such a function to* print* in the html view the same 
 message as in the python code?
 

you can put the file in your modules folder of app. Any way, the code
in the example might not work since web2py doesn't support Python 3

Marco.

-- 
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] Post Request Data

2014-05-22 Thread Marco Mansilla
El Wed, 21 May 2014 08:54:50 -0700 (PDT)
Cory coryb...@gmail.com escribió:

 
 
 On Wednesday, May 21, 2014 6:35:31 AM UTC-7, marco mansilla wrote:
 
  El Tue, 20 May 2014 15:27:29 -0700 (PDT) 
  Cory cory...@gmail.com javascript: escribió: 
 
   Hi, 
   I am trying to access the contents of a post request made to a
   url on my website. 
   To test this I have been trying to send post requests to a url on
   my website to see I if am able to get the data from the post. 
   Does anyone know how I can access the post data? am I accessing
   it correctly by using request.vars?   
   thanks!   
   
   def post_sender(): 
   requests.post(url,data) 
   
   def post_receiver(): 
   if request.vars: 
  do stuff with data 
   
   
   
 
  something like: 
 
  def post_sender(): 
  redirect(URL('youController','post_receiver', 
  vars=dict(myvar=someValue))) 
 
  return dict() 
 
  def post_receiver(): 
  if request.vars.myvar: 
  do stuff with data 
 
  that's pretty much it. 
 
  Marco. 
 
 
 thanks for the response,
 
  I have tried to do the above code, but I am unable to access or view
 the data from the post request. I think this is because every time I
 reload the receiving url to see if I can post the data to the view it
 starts a new session? and gets rid of the post variables that it
 received? 
 
 Does anyone know how I can view the data using the above pseudo code 
 
Once you sent vars you can render it in the view doing
{{=request.vars.myvar}}

try. But would be better to see some code to be more specific.

Marco.

-- 
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] Post Request Data

2014-05-21 Thread Marco Mansilla
El Tue, 20 May 2014 15:27:29 -0700 (PDT)
Cory coryb...@gmail.com escribió:

 Hi,
 I am trying to access the contents of a post request made to a url on
 my website. 
 To test this I have been trying to send post requests to a url on my 
 website to see I if am able to get the data from the post.
 Does anyone know how I can access the post data? am I accessing it
 correctly by using request.vars?  
 thanks!  
 
 def post_sender():
 requests.post(url,data)
 
 def post_receiver():
 if request.vars:
do stuff with data
 
 
 

something like:

def post_sender():
redirect(URL('youController','post_receiver',
vars=dict(myvar=someValue)))

return dict()

def post_receiver():
if request.vars.myvar:
do stuff with data

that's pretty much it.

Marco.

-- 
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] How do I define this item

2014-05-21 Thread Marco Mansilla
El Wed, 21 May 2014 03:01:46 -0700 (PDT)
Maurice Waka mauricew...@gmail.com escribió:

  
 
 When I iterate through the controller as this:
 
 def return_post:
 form = SQLFORM(db.post)
 for c in form:
 form1= post.body
 form2 = form1.split()return dict(form2=form2)
 
 I get an error that form2 is not defined in the view{{=form2}}. 
 
 How do i define this form2?
 

Not very clear to me, calling SQLFORM to form woul create a new post
form, so it is empty. But here you have a syntax error:

form1= post.body

must be

form1= c.post.body

if you want to show the actual posts you should do something like:


def return_post():
form=db(db.post.id0).select()

return dict(form=form)

and in the view only show the body field:


{{for c in post:}}
{{=c.body}}
{{pass}}

or... could you explain a little more about the problem.

Marco.

-- 
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] web2py conference - online talks

2014-05-05 Thread Marco Mansilla
Is there any chance to download this videos to watch offline?, that
would be awesome.

Marco.

 Please find below the links to the video of the first web2py
 conference. Videos are not broken into talks. 
 There is no audio for the first 2minutes but no talk either, only
 service announcements.
 
 
 *Part #1 (from start to lunch break)*
 
 https://colflash.cdm.depaul.edu/colflashweb/COLFlashPlayer.aspx?ID=183272
 
 10:00-10:10! Conference Opening
 
 10:10-10:20! “What's New with the PSF” by Brian Curtin
 
 10:20-11:00! “History of web2py” by Massimo Di Pierro
 
 11:00-11:40! Learn web2py the Really Hard Way by Anthony Bastardi 
 11:40-12:20! Stereodose by Mark Li
 
 12:20-12:30! Planet Host by Jason Burosh
 
 *Part #2 (from tutorial to coffee break)*
 
 https://colflash.cdm.depaul.edu/colflashweb/COLFlashPlayer.aspx?ID=183273
 
 13:00:13:40! hands-on web2py tutorial by Clifford Williams
 
 13:40-14:20! Angular and web2py by Amber Doctor
 
 14:20-14:40 ! Stitching together the tree of life with web2py by
 Richard Ree 1
 
 4:40-15:00! ShipElf: Automated Fulfillment with Web2Py by Peter 
 Szczepanski 
 
 15:00-15:20! MyIRE - What is Open Source Science? by Mark Graves 
 
 15:20-15:40! Introduction to Mongodb by Marco Chou
 
 *Part #3 (from coffee break to end)*
 
 https://colflash.cdm.depaul.edu/colflashweb/COLFlashPlayer.aspx?ID=183274
 
 16:00-16:20! Introduction to OpenShift by Craig Brott
 
 16:20-16:40! Introduction to Hypermedia API by Bryan Barnard 
 
 16:40-17:00! web2py and the Semantic web by Chris Baron 
 
 17:00-17-20! Teaching an old dog new tricks by Don O'Hara 
 
 17:20-17:30! Conference Closing
 

-- 
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] Tk library is not installed which package do I need and where do I install it?

2014-04-26 Thread Marco Mansilla
El Sat, 26 Apr 2014 13:51:18 -0700 (PDT)
Cynthia Butler cindybutl...@gmail.com escribió:

 My machine: ubuntu 14.04 LTS, 64 bit
 My web2py:  2.9.5-stable+timestamp.2014.03.16.02.35.39
 
 I get this when running web2py.py: 
 
 WARNING:web2py:GUI not available because Tk library is not installed
 
 
 I tried downloading/installing Tk 8.6.1 from Active State but it
 didn't fix it.
 
 I also tried:
 sudo apt-get install python-tk
 
 which removed the warning, but I still do not see the GUI/console.
 
 Sorry, I'm a noob. Which package do I need and where do I install it
 to get web2py's GUI/console to display?
 
 Thanks!
 

All you need is python-tk package from repos... but as Massimo says,
you don't really need it for web2py to work, from command line you set
the password for admin with:

   $ python web2py.py -a 'password' 

and you are good to go.

Marco.

-- 
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] Current date/time for datetime field (time is wrong)

2014-04-15 Thread Marco Mansilla
El Tue, 15 Apr 2014 10:13:26 -0700 (PDT)
LoveWeb2py atayloru...@gmail.com escribió:

 Hello,
 
 I love the calendar that pops up in the 'datetime' field with a
 time/date selector. However, when my customers use it their time is
 always off. Is there a way to prepopulate the field with the current
 time, or make a button for them to click which will take their local
 system time?
 

set default=request.now in the table definition

Marco.

-- 
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] httpd internal 500 error -- out of the blue just from typing service httpd restart

2014-04-14 Thread Marco Mansilla
El Mon, 14 Apr 2014 11:28:25 -0700 (PDT)
LoveWeb2py atayloru...@gmail.com escribió:

 I've done this 100 times.
 
 service httpd restart
 and it works fine
 
 I am running web2py with python 2.7 and using the wsgihandler.py with 
 apache.
 
 I've checked the error logs and it says 
 [warn] Init: Name-based SSL virtual hosts only work for clients with
 TLS server name indication support (RFC 4366)
 [notice] Apache/2.2.15 (Unix) DAV/2 mod_wsgi/3.2 Python/2.6.6 
 mod_ssl/2.2.15 PHP/5.3.3 configured -- resuming normal operations
 
 Are there any indicators here why I'm getting the 500 error? This is
 really killing me!! My server is down and no one can access the site
 please help!
 

Not a good solution, but a temporary one... just reboot your server, I
have the same problem and so far couldn't find a solution... No
upgrade/update has been done in the server, this issue came up from
nowhere. 

Rebooting enables apache again, but if you want to restart the apache
service you'll have to restart the whole server.

Cheers.

-- 
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] Re: Ckeditor plugin - Update ckeditor

2014-04-07 Thread Marco Mansilla
El Tue, 25 Mar 2014 16:37:46 -0700 (PDT)
Tim Richardson t...@growthpath.com.au escribió:

 try this
 https://github.com/timrichardson/web2py_ckeditor4/releases/download/R-0.3/web2py.plugin.ckeditor.w2p
 

Hi, I'm having a really hard struggle with this, and so far I am really
sure that is not a ckeditor plugin error, but it is referred to.

I have changed the default template for my app, to one still boostrap
based, but to version 3, and made chages according to this[0] guide.

When I set {{extend 'layout.html'}}, everything works well but when a
change to {{extend 'my-custom-layout.html'}}, seems to be no problem
but the form elements supposed to have the ckeditor widgets show up as
regular text widgets.

Only hint I have is one line in firebug console saying:

   TypeError: jQuery(...).ckeditor is not a function
jQuery('#posts_post_content').ckeditor(config);

The whole script code marked as error is:

script type=text/javascript
function ckeditor_config() {
return {
contentsCss:
['/myapp/static/css/base.css','/myapp/static/plugin_ckeditor/contents.css'],
filebrowserUploadUrl: '/myapp/plugin_ckeditor/upload',
filebrowserBrowseUrl: '/myapp/plugin_ckeditor/browse', toolbar: [
{name: 'clipboard', items: ['Cut', 'Copy', 'Paste',
'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']}, {name: 'editing',
items: ['Find', 'Replace', '-', 'SelectAll', '-', 'SpellChecker',
'Scayt']}, {name: 'links', items: ['Link', 'Unlink', 'Anchor']}, {name:
'insert', items: ['Image', 'Flash', 'Table', 'SpecialChar']}, {name:
'tools', items: ['Maximize', 'ShowBlocks', '-', 'Source']}, '/',
{name: 'styles', items: ['Format', 'Font', 'FontSize']},
{name: 'basicstyles', items: ['Bold', 'Italic', 'Underline',
'Strike', '-', 'RemoveFormat']}, {name: 'paragraph', items:
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent',
'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']}, ],
scayt_autoStartup: true,
}
}

jQuery(function() {
var config = ckeditor_config();
jQuery('#posts_post_content').ckeditor(config); !--fail--
});
/script 

I guess I'm missing some script to include but not shure which one.
Jquery, web2py_ajax, and everything else is called in the custom-layout
file.

Thanks in advance.

Marco

[0]
http://www.web2pyslices.com/slice/show/1516/adapt-a-css-template-to-web2py-layouthtml

-- 
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] Re: Ckeditor plugin - Update ckeditor

2014-04-07 Thread Marco Mansilla
El Mon, 7 Apr 2014 05:17:31 -0300
Marco Mansilla thebigsho...@gmail.com escribió:

 El Tue, 25 Mar 2014 16:37:46 -0700 (PDT)
 Tim Richardson t...@growthpath.com.au escribió:
 
  try this
  https://github.com/timrichardson/web2py_ckeditor4/releases/download/R-0.3/web2py.plugin.ckeditor.w2p
  
 
 Hi, I'm having a really hard struggle with this, and so far I am
 really sure that is not a ckeditor plugin error, but it is referred
 to.
 
 I have changed the default template for my app, to one still boostrap
 based, but to version 3, and made chages according to this[0] guide.
 
 When I set {{extend 'layout.html'}}, everything works well but when a
 change to {{extend 'my-custom-layout.html'}}, seems to be no problem
 but the form elements supposed to have the ckeditor widgets show up as
 regular text widgets.
 
 Only hint I have is one line in firebug console saying:
 
TypeError: jQuery(...).ckeditor is not a function
   jQuery('#posts_post_content').ckeditor(config);
 
 The whole script code marked as error is:
 
 script type=text/javascript
 function ckeditor_config() {
 return {
   contentsCss:
 ['/myapp/static/css/base.css','/myapp/static/plugin_ckeditor/contents.css'],
 filebrowserUploadUrl: '/myapp/plugin_ckeditor/upload',
 filebrowserBrowseUrl: '/myapp/plugin_ckeditor/browse', toolbar: [
   {name: 'clipboard', items: ['Cut', 'Copy', 'Paste',
 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']}, {name: 'editing',
 items: ['Find', 'Replace', '-', 'SelectAll', '-', 'SpellChecker',
 'Scayt']}, {name: 'links', items: ['Link', 'Unlink', 'Anchor']},
 {name: 'insert', items: ['Image', 'Flash', 'Table', 'SpecialChar']},
 {name: 'tools', items: ['Maximize', 'ShowBlocks', '-', 'Source']},
 '/', {name: 'styles', items: ['Format', 'Font', 'FontSize']},
   {name: 'basicstyles', items: ['Bold', 'Italic', 'Underline',
 'Strike', '-', 'RemoveFormat']}, {name: 'paragraph', items:
 ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent',
 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']}, ],
   scayt_autoStartup: true,
   }
   }
 
   jQuery(function() {
   var config = ckeditor_config();
   jQuery('#posts_post_content').ckeditor(config); !--fail--
   });
 /script 
 
 I guess I'm missing some script to include but not shure which one.
 Jquery, web2py_ajax, and everything else is called in the
 custom-layout file.
 
 Thanks in advance.
 
 Marco
 
 [0]
 http://www.web2pyslices.com/slice/show/1516/adapt-a-css-template-to-web2py-layouthtml
 

Sorry... never mind... I just needed to call
plugin_ckeditor/adapters/jquery.js 

Marco.

-- 
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] handbook, Configuring layout

2014-03-30 Thread Marco Mansilla
El Sat, 29 Mar 2014 17:59:19 +
Frank urealfr...@gmail.com escribió:

 Hi,
 
 I’m too newbie to know if this is a typo or an error but,
 here 
 http://web2py.com/books/default/chapter/29/03/overview#Configuring-the-layout
 when Massimo writes “(…) In fact, the static/base.css stylesheet is
 well documented and described in Chapter 5 (…), I can’t find
 any reference to this ‘static/base.css’ file under chapter 5 or under
 the
 official repo 
 https://github.com/web2py/web2py/tree/master/applications/welcome/static/css
 
 Maybe I am missing something or this ‘static/base.css’ file should be
 another one? 
 
 Cheers,
 -- 
 Frank
 

I guess you're looking for web2py.css in static/css/

Marco.

-- 
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] web2py and python3

2014-03-27 Thread Marco Mansilla
El Thu, 27 Mar 2014 04:01:56 -0700 (PDT)
Maurice Waka mauricew...@gmail.com escribió:

 
 Does web2py function with python 3.3 or python 3.4? I have installed
 web2py but it cannot run with the python3.4 that I use. I get an
 error after trying to run the 'web2py.exe - S welcome' that says,
 syntax error
 

You'll have to wait for web3py...

https://github.com/mdipierro/web3py

Marco.

-- 
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.


[web2py] Alternative to reCaptcha?

2014-03-26 Thread Marco Mansilla
Hi, I've been looking for some alternative to *Captcha, and so far I
haven't found somethig original... until now, this[0] looks interesting,
and seems not to be hard to use.

Any ideas about if is possible to integrate it with SQLFORM?

[0] https://github.com/josscrowcroft/MotionCAPTCHA

Thanks in advance.

Marco.

-- 
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][share] gluttony for graph python project dependencies

2014-01-07 Thread Marco Mansilla
El Tue, 7 Jan 2014 14:55:17 -0500
Richard Vézina ml.richard.vez...@gmail.com escribió:

 Ho! Forget about that, there is no web2py pip package and gluttony
 required a pip package to work... So, not possible to make it works
 for app I guess.
 
 Richard
 
 
 On Tue, Jan 7, 2014 at 2:31 PM, Richard ml.richard.vez...@gmail.com
 wrote:
 
  Hello,
 
  I was looking to find a way to compile the dependencies of my
  project and I falled on this :
 
  https://bitbucket.org/victorlin/gluttony
 
  It might be an interesting addon to web2py?
 
  Richard
 
  --
  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/groups/opt_out.
 
 

There **IS**:

$pip install web2py
Downloading/unpacking web2py-2.1.1.tar.gz

but maybe pypi version should be updated... 



  Downloading web2py-2.1.1.tar.gz

-- 
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/groups/opt_out.


Re: [web2py] drop question

2014-01-05 Thread Marco Mansilla
El Sun, 5 Jan 2014 12:22:00 -0800 (PST)
Alex Glaros alexgla...@gmail.com escribió:

 Tried to drop a table and got an error perhaps due to reference to
 other table but the error message misspelled Organization as
 Orgnization but I can't find any reference to Orgnization.  Doesn't
 that mean I had Organization misspelled somewhere?  If yes, where?
 
 
 In [2] : db.Party.drop()
 Traceback (most recent call last):
   File /home/mdipierro/make_web2py/web2py/gluon/contrib/shell.py,
 line 234, in run
   File string, line 1, in module
   File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 8919,
 in drop File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line
 1281, in drop File /home/mdipierro/make_web2py/web2py/gluon/dal.py,
 line 1916, in execute
   File /home/mdipierro/make_web2py/web2py/gluon/dal.py, line 1910,
 in log_execute
 OperationalError: no such table: main.Orgnization
 
 thanks,
 
 Alex Glaros
 

Have you declared your tables in regular model files in /models or in
modules?, would you share the table declaration code?.

-- 
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/groups/opt_out.


Re: [web2py] Help me understand how to create a search

2013-12-23 Thread Marco Mansilla
El Mon, 23 Dec 2013 13:08:20 -0800 (PST)
Keith Planer kwplan...@gmail.com escribió:

 I'm new to web2py, and Python. I created a database, and I want to
 create a page where I can return records from a table of people,
 using their first and last names as search terms. What I have so far
 is:
 
 def patient_lookup():
 
 #form = SQLFORM.grid(db.consumer, deletable = True)
 
form=SQLFORM.factory(
  Field('Lname', requires=IS_IN_SET(consumer)),
  Field('Fname', requires=IS_IN_SET(consumer)),
  submit_button=Search)
 if form.accepts(request.vars, session):
 consumer=db.consumer(id).select()
 return dict(form=form)
 
 
 My error:
 
 
 Traceback (most recent call last):
   File /home/mdipierro/make_web2py/web2py/gluon/restricted.py, line
 217, in restricted File
 C:/web2py_src/web2py/applications/facesheet/controllers/default.py,
 line 64, in module File
 /home/mdipierro/make_web2py/web2py/gluon/globals.py, line 372, in
 lambda File
 C:/web2py_src/web2py/applications/facesheet/controllers/default.py,
 line 38, in patient_lookup Field('Lname',
 requires=IS_IN_SET(consumer)), UnboundLocalError: local variable
 'consumer' referenced before assignment
 
 
 

Would you please show your model file?... it seems that consumer table
isn't created yet... is this right?

-- 
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/groups/opt_out.


Re: [web2py] upgrade failed for 2.8.2

2013-12-02 Thread Marco Mansilla
El Mon, 2 Dec 2013 04:11:05 -0800 (PST)
lucas sjluk...@gmail.com escribió:

 
 
  have you changed permissions to web2py folder?, in centos user and 
  group should be apache, unless you have a modified setup: 
 
  chown -R apache:apache web2py/ 
 
 
 good thought but no, it didn't do the trick.  damn, almost.
 
 hey massimo, what could have changed between 2.4 and 2.8, probably 
 specifically in mod_wsgi.so? 
 
 lucas
 

Have you read apache logs?, this line:

WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py

Have in mind that wsgihandler.py is in web2py/handlers in latest
versions of web2py... you might, also, have to fix permissions for this
file to rwxr-xr-x

-- 
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/groups/opt_out.


Re: [web2py] Testing local site on other machine

2013-12-02 Thread Marco Mansilla
El Mon, 2 Dec 2013 04:46:51 -0800 (PST)
Ruud Schroen r...@formatics.nl escribió:

 Hi,
 
 I'm running web2py on my laptop with Ubuntu and i'd like to test my 
 websites in IE.
 So i'd like to test my local web2py website my desktop, which is a
 Windows machine.
 
 How do i achieve this?
 
 Thanks in advance.
 

set 0.0.0.0 ip to web2py and you can browse web2py server in you lan ip
port 8000, or you can change port too...

-- 
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/groups/opt_out.


Re: [web2py] upgrade failed for 2.8.2

2013-12-02 Thread Marco Mansilla
El Mon, 2 Dec 2013 10:06:38 -0800 (PST)
lucas sjluk...@gmail.com escribió:

 
 
  Have you read apache logs?, this line: 
 
  WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py 
 
  Have in mind that wsgihandler.py is in web2py/handlers in latest 
  versions of web2py... you might, also, have to fix permissions for
  this file to rwxr-xr-x 
 
 
 yes, that did it.  i happened to have read the README under the
 handlers subdirectory and it says that the appropriate file(s) should
 be copied to the parent (web2py) folder.  so instead of doing the
 copy, i did a symbolic link, like ln -s handlers/wsgihandler.py.  i
 also did chmod and chown for that link and restarted apache and it
 worked great. 
 
 can anything be wrong with using the link to the file?  my thinking
 is the when the handler is updated, the link will still be valid.
 
 lucas
 

Not sure, but even if it brokes on upgrade you know what is the
solution...

Marco.

-- 
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/groups/opt_out.


Re: [web2py] upgrade failed for 2.8.2

2013-12-01 Thread Marco Mansilla
El Sun, 1 Dec 2013 20:06:33 -0800 (PST)
lucas sjluk...@gmail.com escribió:

 hey everyone,
 
 i have been trying to update to web2py 2.8.2.  i am running under
 centos 6.3 and apache 2.2.15.  i have done this sort of web2py
 upgrade on this same system a dozen times or so and never had a
 problem.  i simply get the error 404 Not Found under any url like,
 http://localhost; or http://localhost/welcome;.  they also don't
 work under https or port 443. any ideas would be great and
 appreciated.  httpd.conf is left unchanged and is most probable the
 default.  here are my other configs for apache:
 
 in /etc/httpd/conf.d/wsgi.conf:
 
 ...

have you changed permissions to web2py folder?, in centos user and
group should be apache, unless you have a modified setup:

chown -R apache:apache web2py/

-- 
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/groups/opt_out.


Re: [web2py] web2py routes.py

2013-11-24 Thread Marco Mansilla
El Sun, 24 Nov 2013 13:21:22 -0800 (PST)
Gael Princivalle gaelprinciva...@gmail.com escribió:

 Hi.
 
 I've got a domain that is on Webfaction, with a web2py app.
 I just want to have my app on the domain root.
 Now I have:
 https://www.mydomain.com/myapp/default/index
 I would like to see my app on :
 https://www.mydomain.com
 
 I've read that:
 http://web2py.com/book/default/chapter/04#Parameter-based-system
 
 and put a router.py file in my web2py folder with:
 routers = dict(
   BASE  = dict(default_application='myapp'),
 )
 
 Sometimes it works, and sometimes not, admin is ko.
 
 Someone can help me ?
 
 Thanks.
 

I have a vps server and had a similar issue before, but with multiple
domains and subdomains, what I did was to replace content of
default-000.conf which has apache setup, with my custom web2py setup
and that did the trick... maybe could help you, I'm not sure how
webfaction works.

Marco.

-- 
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/groups/opt_out.


Re: [web2py] web2py course

2013-09-10 Thread Marco Mansilla
+1 that would be really cool

 Massimo,
 
 Having a web2py Courses area on web2py.com could be even better for
 advertising!
 
 

-- 
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/groups/opt_out.


[web2py] HTML Table rows to db

2013-08-27 Thread Marco Mansilla
Hi, I'm working in a dynamic invoice app and so far everything it's
almost done, but i need to know if it's possible to send rows from my
dynamically gerated table in view to db.

for example:

this is my basic table
db.define_table('db_products',
Field('barcode'), # I use a barcode reader to get record
Field('name'),
Field('category'),
Field('price'),
Field('stock')# this should be updated
)


after processing json in my view a have a table
table
  thead
  tr
thQuant./th
thName/th
thprice/th
thtotal/th !--this is pice*quant.--
  /tr
  /thead
  tbody
tr
  td2/td
  tdcandy/td
  td1.50/td
  td3.00/td
/tr
tr
  td5/td
  tdcoke/td
  td2.00/td
  td10.00/td
/tr
tr
  td5/td
  tdnoodles/td
  td8.00/td
  td40.00/td
/tr
tr
  td9/td
  tdsomething/td
  td0.40/td
  td3.60/td
/tr

  /tbody
/table

What I need to do is to perform and update in products db and save some
data to another table for reports, using the table rows.

Some hints for this? 

-- 

--- 
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/groups/opt_out.


Re: [web2py] boolean_widget

2013-06-06 Thread Marco Mansilla
El Thu, 6 Jun 2013 16:07:41 -0700 (PDT)
Jose jjac...@gmail.com escribió:

 Hello
 
 I have the following
 
 def boolean_widget(field, value):
 return SELECT(
 OPTION('Si', _value=True),
 OPTION('No', _value=False),
 _name=field.name,
 _id='%s_%s' % (field._tablename, field.name),
 )
 
 
 tb_algo = db.define_table('algo',
 Field('name'),
 Field('test', 'boolean'),
 )
 tb_algo.test.widget = boolean_widget
 
 
 
 the form is displayed well, but always saves True
 
 What this doing wrong?
 
 Jose
 

the boolean types have a default widget, which is a checkbox, when is
checked is True, and when is not is False, becouse it is empty... when
you Choose Si or No, you send a value so you get True becouse it is not
empty to be False.

I thinks that's the problem.

-- 

--- 
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/groups/opt_out.




Re: [web2py] I liked this

2013-06-05 Thread Marco Mansilla
El Wed, 5 Jun 2013 21:02:20 -0700 (PDT)
Massimo Di Pierro massimo.dipie...@gmail.com escribió:

 http://goodui.org/
 

Nice tips, liked too.

-- 

--- 
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/groups/opt_out.




Re: [web2py] Login with ID rather than email?

2013-05-26 Thread Marco Mansilla
El Mon, 27 May 2013 13:00:11 +1000
Alec Taylor alec.tayl...@gmail.com escribió:

 Is it possible to login to web2py by ID rather than by email?
 
 Thanks for all information,
 
 Alec Taylor
 

if you mean something like username yes... and there are some ways to
hardcode the behaviour for this field to take the id value... 

when you define a username field, automatically auth asks for it
instead of email.

Marco.

-- 

--- 
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/groups/opt_out.




Re: [web2py] user comments

2013-05-14 Thread Marco Mansilla
El Tue, 14 May 2013 12:33:51 -0700 (PDT)
BlueShadow kevin.bet...@gmail.com escribió:

 Hi,
 I like to add comments for users to my app. Is there a plugin which
 does all the work for me or do I have to develop it myself? It would
 be awesome if moderators could edit or delete comments.
 

there is [0], but i think it might be out of date, and the threaded
comments plugin is not available, still is not that hard to write the
code yourseft. In the book i think in the services section there's an example 
of LOAD for ajax comments.

[0] http://www.web2py.com/plugins/default/simple_comments

-- 

--- 
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/groups/opt_out.




Re: [web2py] db.count()

2013-04-10 Thread Marco Mansilla
i think it should be:

number_of_records = db(db.countries.id).select().count()

haven't tried it, but you must have all the rows selected to count.

 Hi,
 
 i have this line of code:
 
 number_of_records = db().count(db.countries.id)
 
 i am receiving an error:
 class 'sqlite3.OperationalError' near ;: syntax error
 (self=gluon.dal.SQLiteAdapter object, *a=('SELECT count(DISTINCT 
 countries.id) FROM ;',), **b={})
 
 What is wrong?
 

-- 

--- 
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/groups/opt_out.




Re: [web2py] how to add asterik in mandotry fields

2013-02-13 Thread Marco Mansilla
El Wed, 13 Feb 2013 06:26:41 -0800 (PST)
waqasiqbal.kny...@gmail.com escribió:

 
 i want to add asterik at the end of mandotry fields to show the user
 that you must have to fill that field . But the problem is that there
 is no html file for that and form is built on crude, how should i
 add??  i am in need of its solution kindly help me out.
 

you can add a comment=* and the change the color with css for that
column element

-- 

--- 
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/groups/opt_out.




Re: [web2py] extended bootstrap

2013-01-24 Thread Marco Mansilla
Really nice!, this is going to my current project, thanks for sharing.

 http://jasny.github.com/bootstrap/
 

-- 





Re: [web2py] Unable to UNinstall application

2013-01-17 Thread Marco Mansilla
Apps are created in the /path/to/web2py/applications folder, and are
folders too, so you can delete them from that path.

Marco.

 Hi,
 
 I am new to web2py so probably I am doing something wrong. I used the 
 wizard and (I think it was the wizard that did it) it created a bunch
 of applications - called cron, database, view, there was about 8 or
 10 of them. I didn't make them and it was confusing me so I
 uninstalled most of them, but one called 'ABOUT' when I click
 uninstall it tried to do it but then has an error and says 'unable to
 uninstall ABOUT '. Why were these applications created, and why
 can't I uninstall this one?
 
 I used the wizard again and it only created one application which is
 what I expected in the first place, so I'm very confused.
 
 Update:
 I went into my web2py folder with the idea that I will delete files
 and get a clean install. There was a file ABOUT - not a folder -
 which I deleted and now the project is gone. That's fixed my problem
 (which was really just an annoyance) however I would still like to
 know why these things happened.
 
 Thanks for your help
 

-- 





Re: [web2py] Appliance Manage Contacts - invalid view (default/company_create.html)

2013-01-09 Thread Marco Mansilla
can you show the controller?, maybe it a mistake in the default.py
contoller defining

def company_create():

return dict()

El Wed, 9 Jan 2013 14:53:01 +
António Ramos ramstei...@gmail.com escribió:

 I got this error in Manage Contacts Appliance
 
 
 invalid view (default/company_create.html)
 when creating company
 
 
 Thank you
 

-- 





Re: [web2py] Re: ('web2py' in pycon.us.talks) == False

2012-12-07 Thread Marco Mansilla
Well, to me it seems that DjangoCon has moved to PyCon... so, whatever,
we must have our Web2pyCon and stop trying to be heard by deft people...

PS: i still remember this and is awesome
http://www.youtube.com/watch?v=i6Fr65PFqfk

 Hi folks --
 
 I'm the program chair for PyCon 2013. I can see you've got some
 questions about how the talk selection works, so I'm hoping I can
 chime in and answer some of the questions.
 
 First, Joe Barnhart asks [w]ho in the overall structure of PyCon
 decides these things?  Do they live in the Bay Area?
 
 There isn't a single person who makes decisions; the decision is made
 by the PyCon Program Committee. This year we had about 80 members on
 the committee. I know we had at least a couple who lived in the Bay
 Area, but I think most don't. Membership on this committee is open to
 anyone who wants to join. We had a call for membership in July 
 (http://pycon.blogspot.com/2012/07/i-want-you-for-pycon-program-commitee.html)
  
 and started our work in August. Everyone on the committee (myself
 included) volunteers their time, and the time was substantial -- we
 met daily for most of August and all of September and October.
 
 It's a lot of work, and made quite hard by the volume of submissions
 we have to weigh, but it's actually quite fun most of the time. If
 anyone here's interested, please consider joining next year. It's a
 great way to give back to the Python community!
 
 Next, let me try to answer questions about how the process itself
 works. I'll point you to https://us.pycon.org/2013/pc/guide/, where
 I've done as good a job as I can documenting how the review process
 worked this year. If anyone has questions about specifics after
 reading that I'd be happy to answer them; fire away.
 
 I do specifically want to address something Massimo claims: he writes
 that one negative vote by a self appointed reviewer could kill a
 talk. This isn't true: the decision really is made by the committee.
 We have several rounds of voting, and it takes a strong majority of
 votes to decide a talk in either direction. It has to be this way: no
 single person can be counted on to be totally dispassionate, so when
 we pull together a large committee we can hopefully balance out our
 various biases.
 
 I understand there's a lot of disappointment about web2py not being
 on the program. We had nearly 500 proposals for just over 100 slots
 on the schedule, so we simply couldn't fit in all the good talks that
 were proposed. We did the best we could, but ultimately some things
 are always going to be left out. Many of my favorite topics aren't
 represented in the program, either.
 
 However, the main conference track is just a part of PyCon -- and a 
 relatively small one at that. We have many other events, including 
 lightning talks (short, informal presentations), open spaces (ad-hoc
 talks and gatherings) and sprints (focused development efforts). For
 many people, these less formal parts are actually the highlights. I'm
 one of them: my favorite part of PyCon is the annual testing meetup,
 and event you won't find on the official schedule because it's far
 from formal. I expect web2py to be represented in this spaces, and
 I'd encourage you to come and help make that happen.
 
 In the end, though, I understand your disappointment, and I doubt
 there's much I can tell you that'll change that. I hope you'll
 consider this added impetus to submit awesome web2py talks to PyCon
 next year. Ultimately, that's the only way to make sure your favorite
 topic is covered: submit proposals!
 
 Once again if you've got any more questions I'm happy to answer them
 -- either here or in private email (ja...@jacobian.org).
 
 Thanks for your understanding,
 
 Jacob Kaplan-Moss
 Program Chair, PyCon 2013
 

-- 





[web2py] Pylatte

2012-11-23 Thread Marco Mansilla
Does anyone has any thoughts about Pylatte, so far it seems to be the
first Py3k supported web framework besides Pyramid

http://www.pylatte.org/

which is wreid to me is the fact that is considered the second in the
list and still lacks a lot of features, doesn't have an ORM or
equivalent...

-- 





Re: [web2py] hidden fields ignored in form=crud.update()?

2012-11-23 Thread Marco Mansilla
This line here:

('ERROR','23502', 'null value in column aboutid violates not-null constraint')

it seems that you have set a validator to one of the hidden fields, and
since it doesn't seem to a have a default value either, then it's value
on submit is null and therefore rejected... could you show the table
definition?

 In a function I have the following line of code:
 
 form=crud.update(table=db.aboutText,hidden=dict(nodeID=id,aboutID=HOMEABOUTID),record=row,next=session.crud_next,deletable=True)
 
 In the view the hidden fields are rendered correctly:
 
 input type=hidden value=11 name=nodeID
 input type=hidden value=1 name=aboutID
 
 When I submit the form I get the following error:
 
 Ticket ID 
 
 127.0.0.1.2012-11-22.16-10-08.6c149a65-a3aa-43b5-b417-a44fe61ce122
 class 'gluon.contrib.pg8000.errors.ProgrammingError' ('ERROR',
 '23502', 'null value in column aboutid violates not-null
 constraint') Version web2py™ (2, 2, 1, datetime.datetime(2012, 10,
 21, 16, 57, 4), 'stable') Python Python 2.7.1: 
 /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
   
 Traceback 
 
 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.
 14.
 15.
 16.
 17.
 18.
 19.
 20.
 
 Traceback (most recent call last):
   File /Users/annet/web2py/gluon/restricted.py, line 212, in
 restricted exec ccode in environment
   File /Users/annet/web2py/applications/init/controllers/cmssite.py
 http://127.0.0.1:8000/admin/edit/init/controllers/cmssite.py, line
 417, in module File /Users/annet/web2py/gluon/globals.py, line
 188, in lambda self._caller = lambda f: f() File
 /Users/annet/web2py/gluon/tools.py, line 2912, in f return
 action(*a, **b) File
 /Users/annet/web2py/applications/init/controllers/cmssite.py
 http://127.0.0.1:8000/admin/edit/init/controllers/cmssite.py, line
 239, in homePage
 form=crud.update(table=db.aboutText,hidden=dict(nodeID=id,aboutID=HOMEABOUTID),record=row,next=session.crud_next,deletable=True)
 File /Users/annet/web2py/gluon/tools.py, line 3511, in update
 detect_record_change=self.settings.detect_record_change): File
 /Users/annet/web2py/gluon/sqlhtml.py, line 1475, in accepts
 self.vars.id = self.table.insert(**fields) File
 /Users/annet/web2py/gluon/dal.py, line 7806, in insert ret =
 self._db._adapter.insert(self,self._listify(fields)) File
 /Users/annet/web2py/gluon/dal.py, line 1161, in insert raise e
 ProgrammingError: ('ERROR', '23502', 'null value in column aboutid
 violates not-null constraint')
 
  Error snapshot [image: help]  
 
 class 'gluon.contrib.pg8000.errors.ProgrammingError'(('ERROR',
 '23502', 'null value in column aboutid violates not-null
 constraint')) 
 
 inspect attributes 
  Frames 

-  

*File /Users/annet/web2py/gluon/restricted.py in restricted at
 line 212* code arguments variables 
 -  

*File /Users/annet/web2py/applications/init/controllers/cmssite.py
 in module at line 417* code arguments variables 
 -  

*File /Users/annet/web2py/gluon/globals.py in lambda at line
 188* code arguments variables 
 -  

*File /Users/annet/web2py/gluon/tools.py in f at line 2912* code 
arguments variables 
 -  

*File /Users/annet/web2py/applications/init/controllers/cmssite.py
 in homePage at line 239* code arguments variables 
 -  

*File /Users/annet/web2py/gluon/tools.py in update at line 3511*
 code arguments variables 
 -  

*File /Users/annet/web2py/gluon/sqlhtml.py in accepts at line
 1475* code arguments variables 
 -  

*File /Users/annet/web2py/gluon/dal.py in insert at line 7806*
 code arguments variables 
 -  

*File /Users/annet/web2py/gluon/dal.py in insert at line 1161*
 code arguments variables 
 Function argument list 

(self=gluon.dal.PostgreSQLAdapter object, table=Table aboutText 
(id,nodeID,aboutID,text,createdOn,modifiedOn),
 fields=[(gluon.dal.Field 
object, 'h4emIedereen is welkom bij het USC!/em/h4...ard
objectis overal 
een horecavoorziening aanwezig./p'), (gluon.dal.Field object, 
datetime.datetime(2012, 11, 22, 16, 10, 8, 432055)),
 (gluon.dal.Field 
object, datetime.datetime(2012, 11, 22, 16, 10, 8, 432055)), 
(gluon.dal.Field object, ''), (gluon.dal.Field object, '')])
 Code listing 

1156.
1157.
1158.
1159.
1160.
1161.

1162.
1163.
1164.
1165.

try:
self.execute(query)
except Exception, e:
if isinstance(e,self.integrity_error_class()):
return None
raise e

if hasattr(table,'_primarykey'):
return dict([(k[0].name, k[1]) for k in fields \
 if k[0].name in table._primarykey])
id = self.lastrowid(table)

 Variables  e ProgrammingError('ERROR', '23502', 'null value in
 column aboutid violates not-null constraint')

 
 Why are 

Fw: [web2py] SQLFORM.smartgrid. This is a bug?

2012-11-14 Thread Marco Mansilla


Inicio del mensaje redirigido:

Fecha: Tue, 13 Nov 2012 15:27:38 -0300
Desde: Marco Mansilla conta...@marcomansilla.com.ar
Para: web2py@googlegroups.com
Asunto: Re: [web2py] SQLFORM.smartgrid. This is a bug?


still you need to give to orderby the name of the field that you want
to order, even when the table has only one field... but the error seems
odd...

def something():
 grilla = SQLFORM.smartgrid(table_1, orderby=table_1.name)

also, since you you don't use represent you could add format at the end
of your table definition...

#Model:
table_1 = db.define_table('table1',
Field('name'),
format='%(name)s')
 
 
 El martes, 13 de noviembre de 2012 02:10:03 UTC-3, marco mansilla
 escribió:
 
  aren't you missing the db. before table? 
 
 
  
 No, the way I define the table is not necessary
 
 table_1 = db.define_table('table1',
 Field('name'),
 )
 
 *table_1 *is equals to* db.table1*
 
 Jose
 

-- 





Re: [web2py] SQLFORM.smartgrid. This is a bug?

2012-11-12 Thread Marco Mansilla
aren't you missing the db. before table?

like

def something():
 grilla = SQLFORM.smartgrid(db.table_1)

and then for the orderby statement should be:

def something():
 grilla = SQLFORM.smartgrid(db.table_1, orderby=db.table_1.field)


that should work.

 Hello
 
 Suppose we have the following:
 
 #Model:
 table_1 = db.define_table('table1',
 Field('name'),
 )
 
 
 
 table_2 = db.define_table('table2',
 Field('field1'),
 Field('field2', table_1),
 )
 
 
 #Controller:
 
 def something():
 grilla = SQLFORM.smartgrid(table_1)
 
 
 
 this shows me the grid with records from table1 and a link to another
 grid with table2 records. This is correct.
 
 But if I do the following:
 
 def something():
 grilla = SQLFORM.smartgrid(table_1, orderby= table_1)
 
 
 The first grid shows good and well ordered, but when trying to
 display records from table2 through the link, can't get the records
 because it is sort of a field belonging to table1
 
 *Query Not Supported: no such column: table1.name*
 *
 *
 
 Jose
 

-- 





[web2py] fancybox forms issue

2012-09-18 Thread Marco Mansilla
Hi everyone, i try not to ask here before googling my issues but so far
i haven't found solution for this one:

i have this in my model db.py

db.define_table('person',
Field('first_name'),
Field('last_name'),
Field('address'),
Field('phone'),
Field('email'),
)

in my controller i have:

registration.py

def person():
form = SQLFORM(db.person)

if form.process().accepts:
response.flash=text
elif form.errors:
response.flash=another text
else:
response.flash=load your personal information please

return dict(form=form)

def index():
return dict()

now comes the heavy part, i want to use fancybox to show my
registration/person form in my registration/index i have the following
code:

index.html

1|{{extend 'layout.html'}}
2|{{include 'web2py_ajax.html'}}
3|
4|script type=text/javascript src=../static/js/fancybox.js/script 
5|
6|link href=../static/css/fancybox.css rel=stylesheet type=text/css 
7|script type=text/javascript
8|$(document).ready(function(){
9|$('.frame').fancybox({
10|width:'98%',
11|height:'98%',
12|}); //end iframe
13|}); //end ready
14|/script
15|
16|
17| 
18|ul
19|  li{{=A('link',callback=URL('registration','person'), 
_class=frame)}}/li 
20|/ul

and simply it does not work, when i click the link it says The
requested content cannot be loaded. Please try again later. in the
box, i have tried to link the file in line 4 inside of layout.html and
still doesn't work, after a long time i'm starting to think that it may
be a permission issue since y have tested this possibilities too:

a class=frame onclick=ajax('/myapp/registration/person',[],'');return 
false href=#nullNew Person/a 

still nothing, and no errors show up in firebug, hints?

-- 





  1   2   >