[web2py] Re: install js package to web2py

2018-02-10 Thread 黄祥
i think, it's depend where do you installed it (global or not), assuming 
you follow the instruction on github and execute npm install nipplejs 
--save in folder static then in your view, you define the path on that 
folder
e.g. not tested
views/default/index.html


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.


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

2018-02-10 Thread Massimo Di Pierro
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.


[web2py] Re: Just a silly thread to say... thanks to all web2py developers team

2018-02-10 Thread Massimo Di Pierro
Well. thank you. It means a lot to all of us. 

On Friday, 9 February 2018 03:42:10 UTC-6, Jaime Sempere wrote:
>
> Hi,
>
> this is gonna sound a littile silly, but I have been wanting to publish a 
> thread like this from years ago.
>
> I just wanna say to Massimo and all the web2py developers one thing: 
> thanks. Thanks a lot.
>
> I love web2py and I enjoy programming and developing with it.
>
> I can notice all the effort and all the work you have made to create a 
> super simple, easy, fun, and good programmed framework like web2py.
>
> Everytime I need to develop a new personal project, I always choose web2py 
> if I can.
>
> I see magic and simplicity in every aspect of web2py. I could not imagine 
> a quicker framework than web2py.
>
> And everytime I need to do something new, when I look to the book, I 
> always find a very easy and simple way to do it. And that's something I 
> love: I find that you have worked a lot to build something simple and 
> powerful. Programming should be like that: simple, non verbose, and fun. 
> Like 'just focus  on the logic and forget about verbose, and extra code, or 
> anything too complicated'... keep it simple, stupid!
>
> And the integrations that you have made possible with GAE or Heroku... oh 
> come on, someone gives these guys a medal!
>
> Or any time that I need to make a customization, or touch anything from 
> the core, I always think to myself: 'this is perfectly programmed, this is 
> exactly how I would develop it', it is like web2py read my mind or if it 
> had same way of thinking as me.
>
> I find magic and roids in every aspect of web2py.
>
> And by the way, vim and web2py make a wonderful team. I feel like a super 
> fanatic boy of both of them...
>
> Well I do not know if this sounds too foolish, but I just want to say to 
> all the members that made and make web2py a solid framework that: thanks, 
> my respects and keep making this framework a reality.
>
> Plus, this group is wonderful support.
>
> Well, that's enough, maybe this can sound awkward or a typical fan-boy 
> thread... but for a last time, thanks to all of you.
>
> Jaime
>

-- 
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: only static files forbidden on centos 7.4 apache 2.4

2018-02-10 Thread 黄祥
better use nginx to serve web2py, found a lot of problem when using apache 
with web2py

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.


[web2py] Re: query to match if boolean field is not True

2018-02-10 Thread Massimo Di Pierro
I would expect that too but it is not a web2py issue. It is a database 
issue. web2py simply translate those in

NOT mytable.boolean_field = 'T'

On Tuesday, 6 February 2018 17:32:44 UTC-6, David Zejda wrote:
>
> Hi :)
>
> Intuitively I would expect that these queries are equivalent ways to match 
> if boolean_field is not True:
>
> ~(db.mytable.boolean_field == True)
>
> (db.mytable.boolean_field != True)
>
> ((db.mytable.boolean_field == None) | (db.mytable.boolean_field == False))
>
> But only the last one works as expected.
>
> David
>

-- 
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: PYTHON 3

2018-02-10 Thread Massimo Di Pierro
Let's be clear web2py supported python3 for some time thanks to you, 
Paolo, and many others. Support is getting betters. yet one needs web2py 
apps written in python 3 to run with web2py on python 3. Apps written for 
python 2 will not work without some refactoring.

On Saturday, 10 February 2018 07:11:54 UTC-6, Leonel Câmara wrote:
>
> It has already happened. Web2py does support python 3, if you see all the 
> latest commits in the github repository have been to fix python 3 issues as 
> obviously it hasn't been tested as much as python 2.7. Problems you have 
> due to python 3 are considered web2py bugs so it's definitely supported.
>

-- 
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-02-10 Thread Massimo Di Pierro
OK. will update as soon as we release a new version.

On Wednesday, 7 February 2018 21:55:28 UTC-6, jim kaubisch wrote:
>
> Just to clarify, the web2py.app file in the "mac_osx.zip" is the one that 
> looks to be out of date
>
> 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] 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" 
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.


[web2py] Re: Should I use the menu helper for this?

2018-02-10 Thread Massimo Di Pierro
I would recommend you do it manually. replace{{=MENU}} with

{{for item in menu:}}


{{=item[0]}}


{{pass}}

On Monday, 5 February 2018 12:25:26 UTC-6, LoveWeb2py wrote:
>
>
> Hello,
>
> response.side_menu = [
> (T('First Section'), False, URL('#'),[
> (SPAN('Section 1a'), False, URL('#'), []),
>
> (SPAN('Section 1b'), False, URL('#'), []),
>
> ])
> ]
>
>
> Which would allow me to use...
>
> {{if response.menu:}}
> {{=MENU(response.menu, _class='sidebar-content', li_class='', 
> ul_class='??')}}
> {{pass}}
>
>
> I'm trying to use the MENU helper and can't seem to find a good way to 
> make it conform to the following:
>
> 
>
> 
>  alt="Logo" />
> 
> 
> 
> 
> 
>  src="{{=URL('static','assets/images/spin-logo-big-inver...@2x.png')}}" 
> alt="Logo" width="53">
>  src="{{=URL('static','assets/images/spin-logo-slim.png')}}" alt="Logo">
> 
>
>
> 
> 
> 
> 
>  class="nav-label">First Section 
> 
> 
> 
>
> 
> C2 
> 
> 
> 
> Section 
> 1.a
> 
> 
> Section 
> 1.b
> 
> 
> 
> 
> 
> 
> 
>  class="nav-label">Settings 
> 
> 
> 
>
>
> What is the best way to approach this? Thank you
>
>
>

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


[web2py] Re: Help with MSSQL Connection

2018-02-10 Thread Massimo Di Pierro
you may have multiple versions of python installed.

On Wednesday, 1 July 2015 14:50:49 UTC-5, JC wrote:
>
> Hello 
> I had a similar problem, causes by 2 things:  1- sql configuration was 
> wrong.  2-  I need to specify the path fro the pyodbc location.
> Hope this help you
>
>
> On Tuesday, June 30, 2015 at 1:49:40 PM UTC+1, Massimiliano wrote:
>>
>> Hello, 
>>
>> I've a problem with odbc. 
>>
>> I'm developing on OSX 10.10.3 and I found some problems connecting to sql 
>> server express 2005
>>
>> I'm tried few things
>>
>> 1. I installed pyodbc and web2py said:
>>
>> Version 2.10.4-stable+timestamp.2015.04.26.15.11.54
>> Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000, 
>> pyodbc
>>
>> but from ipython:
>>
>> import pyodbc 
>> gave me an error.
>>
>> tracing web2py, it failed importing pyodbc... It's normal that web2py 
>> includes pyodbc in drivers available if it fail to import pyodbc?
>>
>> 2. I installed from brew unixodbc
>>
>> but now, when I try to connect to mssql with the following connection 
>> strings:
>>
>> db = DAL("mssql://sa:...@192.168.0.19\SQLEXPRESS/TESTDB")
>> or
>> db = DAL("mssql3://sa:...@192.168.0.19\SQLEXPRESS/TESTDB")
>> I got this error:
>>
>> RuntimeError: Failure to connect, tried 5 times:
>> Traceback (most recent call last):
>>   File "pydal/base.py", line 435, in __init__
>> self._adapter = ADAPTERS[self._dbname](**kwargs)
>>   File "pydal/adapters/base.py", line 53, in __call__
>> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>>   File "pydal/adapters/mssql.py", line 155, in __init__
>> if do_connect: self.reconnect()
>>   File "pydal/connection.py", line 105, in reconnect
>> self.connection = f()
>>   File "pydal/adapters/mssql.py", line 153, in connector
>> return self.driver.connect(cnxn, **driver_args)
>> Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL 
>> Server' : file not found (0) (SQLDriverConnect)")
>>
>>
>> Could someone help me?
>> The application with be deployed on debian 7, do you think there are 
>> problems also there?
>>
>> Thank you
>>
>> -- 
>> Massimiliano
>>
>

-- 
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] install js package to web2py

2018-02-10 Thread Mario Breški
Hi all, I'm noob still in web programming and in web2py so I'm stuck here.

I want to add virtual joystick button to my page and I find out about the 
stuff on github. I don't know how to implement that to my web2py 
application. Any help would have been appriciated

https://github.com/yoannmoinet/nipplejs

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


[web2py] Re: Web2py scheduler

2018-02-10 Thread Massimo Di Pierro
Please install and use psycopg2. There are known issues with pg8000. 

On Tuesday, 6 February 2018 08:17:51 UTC-6, Simona Chovancová wrote:
>
> solved, ran worker in different application than the task was sent from
>
> On Tuesday, February 6, 2018 at 2:34:24 PM UTC+1, Simona Chovancová wrote:
>>
>> Hello,
>>
>> I'm having trouble using the scheduler. I have managed to set it up to 
>> queue tasks and successfully complete them. Although, that only works if I 
>> do not use database. If I include db in function that is tasked, I get this:
>>
>> Traceback (most recent call last):
>>   File "/srv/www/web2py/gluon/shell.py", line 273, in run
>> exec(python_code, _env)
>>   File "", line 1, in 
>>   File "/srv/www/web2py/gluon/scheduler.py", line 735, in loop
>> self.wrapped_report_task(task, self.async(task))
>>   File "/srv/www/web2py/gluon/scheduler.py", line 889, in 
>> wrapped_report_task
>> db.rollback()
>>   File "/srv/www/web2py/gluon/packages/dal/pydal/base.py", line 956, in 
>> rollback
>> self._adapter.rollback()
>>   File "/srv/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
>> 1342, in rollback
>> return self.connection.rollback()
>>   File "/srv/www/web2py/gluon/contrib/pg8000/core.py", line 1429, in 
>> rollback
>> self.execute(self._cursor, "rollback", None)
>>   File "/srv/www/web2py/gluon/contrib/pg8000/core.py", line 1626, in 
>> execute
>> self.handle_messages(cursor)
>>   File "/srv/www/web2py/gluon/contrib/pg8000/core.py", line 1774, in 
>> handle_messages
>> raise self.error
>> ProgrammingError: ('ERROR', '42P05', 'prepared statement 
>> "pg8000_statement_13" already exists')
>>
>> Also, if I do just simple inserts like db.table.insert(something="abc"), 
>> I also include db.commit(), I get this error:
>>
>> Database drivers available: sqlite3, imaplib, pymysql, pg8000
>> starting single-scheduler for "myapp"...
>> ERROR:web2py.scheduler.servername#3711:error storing result
>>
>>
>> Can someone please point me to the right direction?
>> 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] Re: Demo site pointed from About page is not working

2018-02-10 Thread Massimo Di Pierro
It means it cannot even save the ticket because no write access to the 
filesystem.

On Tuesday, 6 February 2018 13:53:08 UTC-6, Marcelo Huerta wrote:
>
> The about page of the main web2py site (
> http://web2py.com/init/default/what) points to a demo page at 
> http://www.web2py.com/demo_admin, but the demo is not working, it fails 
> attempting to create a ticket but the "ticket number" is "unknown".
>
> Either the demo or the page should be fixed...
>

-- 
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: only static files forbidden on centos 7.4 apache 2.4

2018-02-10 Thread lucas
better use nginx to serve web2py, found a lot of problem when using apache 
with web2py

is it really much much better?  in what ways?  why would I change?  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.


[web2py] Re: Intersection of rows

2018-02-10 Thread Dave S
On Friday, February 9, 2018 at 5:26:35 PM UTC-8, Anthony wrote:
>
> Anyway, given your code, it looks like we would not expect any results in 
>>> the intersection of the two Rows objects, as the conditions of each query 
>>> are mutually exclusive (i.e., "waypoint" either equals X or Y). Of course, 
>>> if X == Y, then the two sets of Rows are identical, but I assume that isn't 
>>> generally the case.
>>>
>>>
>> A segment row will only have one waypoint, but multiple segment rows may 
>> have the same parent run.  I chose to make the run table very simple (and 
>> in particular, not to have a list of children), but the segment table 
>> points upward to the run.
>>
>
> Your code doesn't show which columns are selected -- I suppose you are 
> saying the "waypoint" column is *not *selected.
>
> Anthony
>

Well, here's the code actually being used, now that my home dev machine is  
able to reach the interwebs again.

segq1 = db.segment.waypoint.contains(request.args[0])
segq2 = db.segment.waypoint.contains(request.args[1])
runs1 = db((db.run.id == db.segment.partof) & segq1).select("run.id", 
"run.description", "run.distance","run.duration", orderby = db.run.id|db.run
.duration, distinct=True)
runs2 = db((db.run.id == db.segment.partof) & segq2).select("run.id", 
"run.description", "run.distance","run.duration", orderby = db.run.id|db.run
.duration, distinct=True)


At this point in the code, I'm only interested in the waypoints as a link 
to the parent runs.  The goal is to make a list of runs that have both 
waypoints as children. (That is, runs that have at least 2 segments, and 
one segment contains waypoint X and one segment contains waypoint Y.)

That list will be displayed showing the run.id/s (as a link), the distance, 
and the duration.  Clicking on an id will show the details of that run by 
selecting ALL the segments.

Sample list of runs:

run.idrun.descriptionrun.distance  run.duration
> 17Work to 73 mrg via PP7.9 9.0
> 19Work to Home by AVP 19.521.0
> 20Work to 73 mrg by La Paz 7.712.0
> 21Work to Home by La Paz  19.224.0


Sample for details of one run  (sorry about the wrap):

> segmentrunwaypointvia  
>   timeodometerbeginsendscomments
> 422017-05-29, Work to 73 mrg via PPOffice AVP  
> 12:20:0035.0TrueFalse
> 432017-05-29, Work to 73 mrg via PPPacific Park   Pacific 
> Park 12:21:0036.5FalseFalse
> 442017-05-29, Work to 73 mrg via PPMoultonOso 
> Parkway  12:24:0038.4FalseFalse
> 452017-05-29, Work to 73 mrg via PPCabot  I-5  
> 12:26:0040.4FalseFalse
> 462017-05-29, Work to 73 mrg via PP73S merge  I-5  
> 12:29:0042.9FalseTrue


(I suppose I don't really need to display the IDs as well as the run 
"names", but it's useful during development)

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


[web2py] Re: Intersection of rows

2018-02-10 Thread Anthony

>
> segq1 = db.segment.waypoint.contains(request.args[0])
> segq2 = db.segment.waypoint.contains(request.args[1])
> runs1 = db((db.run.id == db.segment.partof) & segq1).select("run.id", 
> "run.description", "run.distance","run.duration", orderby = db.run.id|db.
> run.duration, distinct=True)
> runs2 = db((db.run.id == db.segment.partof) & segq2).select("run.id", 
> "run.description", "run.distance","run.duration", orderby = db.run.id|db.
> run.duration, distinct=True)
>
>
How about:

query = (db.run.id == db.segment.partof) & segq1 & segq2
theruns = db(query).select("run.id", "run.description", "run.distance", 
"run.duration",
   orderby=db.run.id|db.run.duration, distinct=True)

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.


[web2py] only static files forbidden on centos 7.4 apache 2.4

2018-02-10 Thread lucas
hey all,

setting up a new server on centos 7.4 and apache 2.4.  web2py is running 
fine for i get the welcome content but none of the files under static are 
coming down to the client. please makes suggestions.  thank you.

lucas

here is my default.conf file where you'll see i've tried a bunch of 
options.  nothing worked so far.:

NameVirtualHost *:80

NameVirtualHost *:443




  WSGIProcessGroup web2py

#  WSGIDaemonProcess web2py user=apache group=apache display-name=%{GROUP}

  WSGIPassAuthorization On


  

AllowOverride None

Order Allow,Deny

Deny from all



  Require all granted

  Allow from all



  


  AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
/opt/web-apps/web2py/applications/\$1/static/\$2

#  AliasMatch ^/([^/]+)/static/(.*) 
/opt/web-apps/web2py/applications/$1/static/$2


  

#Options -Indexes

Order Allow,Deny

Allow from all

#Require all granted

  


  

Deny from all

  


  

Deny from all

  


  CustomLog /var/log/httpd/access_log common

  ErrorLog /var/log/httpd/error_log






#  SSLEngine on

#  SSLCertificateFile /etc/httpd/ssl/self_signed.cert

#  SSLCertificateKeyFile /etc/httpd/ssl/self_signed.key


  WSGIProcessGroup web2py

#  WSGIDaemonProcess web2py user=apache group=apache display-name=%{GROUP}

  WSGIPassAuthorization On


  

AllowOverride None

Order Allow,Deny

Deny from all



  Require all granted

  Allow from all



  


  AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
/opt/web-apps/web2py/applications/\$1/static/\$2

#  AliasMatch ^/([^/]+)/static/(.*) 
/opt/web-apps/web2py/applications/$1/static/$2


  

#Options -Indexes

#ExpiresActive On

#ExpiresDefault "access plus 1 hour"

Order Allow,Deny

Allow from all

#Require all granted

  


  CustomLog /var/log/httpd/access_log common

  ErrorLog /var/log/httpd/error_log



-- 
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: PYTHON 3

2018-02-10 Thread Leonel Câmara
It has already happened. Web2py does support python 3, if you see all the 
latest commits in the github repository have been to fix python 3 issues as 
obviously it hasn't been tested as much as python 2.7. Problems you have 
due to python 3 are considered web2py bugs so it's definitely supported.

-- 
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] PYTHON 3

2018-02-10 Thread LoveWeb2py
Need to know if this is actually going to be happening soon.  We're making 
critical design choices now and will be implementing next month.  We currently 
use web2py,  but obviously it doesn't support python3. 


PS: For the love of all that's holy,  please don't name it web3py. Web2py v3 
makes more sense. 

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