Re: [web2py] Re: dna analysis web2py github project error ?

2019-07-04 Thread imran tube
thanks stifan ..
again thanks ..for replay  my all query & for giving solution always !


On Wed, Jul 3, 2019 at 4:36 PM 黄祥  wrote:

> yes .my windows python 3.7.3 now ! what can i do for removing error ?
>> suggest me where i should change for update python code .?
>>
>
> pls follow roberto advice to use python 2.7, because cstringio no longer
> exist on python3
> ref:
>
> https://stackoverflow.com/questions/30377620/python-3-4-cstringio-vs-stringio/30379057
>
> 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/4e88799c-816f-41e3-b046-c09a3e96940e%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/CAP%3DDjNLYzY2ajqnsVR8AW_yHgvkOnkuwzeGURpTdiHtgy%3DEysg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: dna analysis web2py github project error ?

2019-07-04 Thread imran tube
2.7 also not working .for  dna apps .see error

On Thu, Jul 4, 2019 at 5:30 PM imran tube  wrote:

> thanks stifan ..
> again thanks ..for replay  my all query & for giving solution always !
>
>
> On Wed, Jul 3, 2019 at 4:36 PM 黄祥  wrote:
>
>> yes .my windows python 3.7.3 now ! what can i do for removing error ?
>>> suggest me where i should change for update python code .?
>>>
>>
>> pls follow roberto advice to use python 2.7, because cstringio no longer
>> exist on python3
>> ref:
>>
>> https://stackoverflow.com/questions/30377620/python-3-4-cstringio-vs-stringio/30379057
>>
>> 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/4e88799c-816f-41e3-b046-c09a3e96940e%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/CAP%3DDjN%2BpYcGW0WKhf0%2BseK%2B7AjHcULKfWrAoZ_gd7pSiLtLgzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: dna analysis web2py github project error ?

2019-07-04 Thread 黄祥

>
> 2.7 also not working .for  dna apps .see error 
>

unsupported pickle protocol 3
already discussed on this thread :
https://groups.google.com/forum/#!msg/web2py-developers/4W4I1FBlGgI/t2ulp1AICgAJ
 

another ref:
https://stackoverflow.com/questions/25843698/valueerror-unsupported-pickle-protocol-3-python2-pickle-can-not-load-the-file

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/534fb9ac-34db-45fc-b3fa-152c3cc9c748%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] molecular /chemical structure editor base ,database search system support by web2py model ?

2019-07-04 Thread imran tube
have any suggestion or documentation for doing this by web2py ?


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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8ba1293d-c338-4b3d-b31b-31dc8d8efd9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] default/user/profile 404 NOT FOUND

2019-07-04 Thread 'Annet' via web2py-users
All of a sudden this  link 
http://127.0.0.1:8000/controlpanel/default/user/profile
no longer works, instead of returning the form it returns a 404 NOT FOUND.

I didn't change anything in the user function, so I have no idea why this 
happens.


Kind regards,

Annet

-- 
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/e1c794d0-d5ce-439f-bfc9-d0539dfe7f5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] web2py scripts (homemade task queues) and python2 compatibility

2019-07-04 Thread Tom Clerckx
Can anyone confirm that backward compatibility with python2 is broken with 
respect to web2py scripts (or homemade task queueus)?
I just downloaded version "2.18.5-stable+timestamp.2019.04.08.04.22.03" and 
it looks like the python3 print() function must be used.

Is there any plan to fix this? If not, it would be good to include this 
information in the web2py book.


Test01:
=
script "applications/examples/scrips/script01.py" containing only one line:
print("Test print")

This one executes fine when running:
python web2py.py -S examples -M -R applications/examples/scrips/script01.py


Test02:
==
script "applications/examples/scrips/script01.py" containing only one line:
print "Test print"

This one fails fine when running:
python web2py.py -S examples -M -R applications/examples/scrips/script01.py

Traceback (most recent call last):
  File "/home/tclerckx/Downloads/web2py/gluon/shell.py", line 275, in run
execfile(startfile, _env)
  File "applications/examples/scrips/script01.py", line 1
print "Test print"
 ^
SyntaxError: invalid syntax

-- 
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/4c095bb7-1cd8-47a2-9b71-94a735dd5681%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] set variable on models or modules

2019-07-04 Thread 黄祥
is there any difference to set variable on models or modules ?
*e.g.*
*models/db_connect.py*
db = DAL('sqlite://test.sqlite', pool_size = 1)

*modules/db_connect.py*
from gluon.dal import DAL
from gluon import current
db = DAL('sqlite://test.sqlite', pool_size = 1)
cache = current.cache
cache_time_expire = 10
cache_model = cache.ram # cache.ram, cache.disk, cache.memcache, cache.redis
cache_db = (cache_model, cache_time_expire)

*controllers/install.py*
import db_connect
def index():
db = db_connect.db
db_schema_1_address.define(db = db)
address_id_1 = db.address.insert(street = 'a', zip_code = '1', city = 
'a', country = 'a')

*controllers/api.py*
import db_connect
#db = db_connect.db # not worked, must use from models/db.py
cache_db = db_connect.cache_db # this variable can be used from modules, no 
error occured
db_schema_1_address.define(db = db)

def response_json_rows():
if not request.env.request_method == 'GET': raise HTTP(403)
table_name = request.args(0)
id = request.args(1)
if id.isdigit() and int(id) > 0:
query = (db[table_name]['id'] == id)
else:
query = (db[table_name]['id'] > 0)
rows = db(query).select(orderby = ~db[table_name]['id'], 
cache = cache_db, 
cacheable = True)
return response.json(rows)

Traceback (most recent call last):
  File "/Users/sugizo/learn/python/web2py/gluon/restricted.py", line 219, in 
restricted
exec(ccode, environment)
  File 
"/Users/sugizo/learn/python/web2py/applications/test/controllers/api.py", 
line 24, in 
db_schema_1_address.define(db = db)
  File "applications/test/modules/db_schema_1_address.py", line 64, in 
define
format = lambda r: \
  File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/base.py", 
line 581, in define_table
raise SyntaxError('table already defined: %s' % tablename)
SyntaxError: table already defined: address

any ideas ?
intention is to move define tables from models into modules and load it on 
controller when it's required, with minimal effort

thx n 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/a14018c6-f1d2-4621-8ea2-e6c4f82876de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py scripts (homemade task queues) and python2 compatibility

2019-07-04 Thread Nico Zanferrari
Hi Tom,

even the latest  2.18.5 version of web2py is still fully compatible with
Python 2.7.

I think you're running both of your tests with python 3 ;-)
Another possibility is that you've first run your web2py framework with
python 3 and then with python 2 -  you cannot mix them without cleaning up
caches and dbs... Try test02 a fresh copy of the web2py sources, after
being sure to use python2!

Nico

Il giorno gio 4 lug 2019 alle ore 17:41 Tom Clerckx  ha
scritto:

> Can anyone confirm that backward compatibility with python2 is broken with
> respect to web2py scripts (or homemade task queueus)?
> I just downloaded version "2.18.5-stable+timestamp.2019.04.08.04.22.03"
> and it looks like the python3 print() function must be used.
>
> Is there any plan to fix this? If not, it would be good to include this
> information in the web2py book.
>
>
> Test01:
> =
> script "applications/examples/scrips/script01.py" containing only one line:
> print("Test print")
>
> This one executes fine when running:
> python web2py.py -S examples -M -R applications/examples/scrips/script01.py
>
>
> Test02:
> ==
> script "applications/examples/scrips/script01.py" containing only one line:
> print "Test print"
>
> This one fails fine when running:
> python web2py.py -S examples -M -R applications/examples/scrips/script01.py
>
> Traceback (most recent call last):
>   File "/home/tclerckx/Downloads/web2py/gluon/shell.py", line 275, in run
> execfile(startfile, _env)
>   File "applications/examples/scrips/script01.py", line 1
> print "Test print"
>  ^
> SyntaxError: invalid syntax
>
> --
> 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/4c095bb7-1cd8-47a2-9b71-94a735dd5681%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/CAAE8D_AWT77sC-kwt5v72jx53nfSu2tzeH%3DqQcZjtPVSsyq6QQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Encoding problem with a web2py application that implements an XMLRPC webservice

2019-07-04 Thread Lisandro
I need to understand if this is a bug or if it is the expected behaviour 
and I'm doing something wrong.

I have two web2py applications. One of them implements an XMLRPC 
webservice, and the other one consumes it.

All the controllers (in both applications) have this first line:
# -*- coding: utf-8 -*-


One of the applications connects to the webservice to call a specific 
function, and it needs to pass some string arguments:

def make_the_call(): 
from xmlrpclib import ServerProxy
service = ServerProxy(webservice_url)
data = {
'title': 'áéíóú',
'detail': 'Detail with special characters like ñ or Ç'
}
service.add_content(data)


The application that implements the webservice:

from gluon.tools import Service

service = Service()


def call():
return service()


def add_content(data):
db.content.insert(
title=data.get('title'),
detail=data.get('detail')
)
return {'success': True}


But the sentence service.add_content(data) fails with this error and 
traceback:

Traceback (most recent call last):
  File "/home/gonguinguen/medios/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
  File "/home/gonguinguen/medios/applications/webmedios/controllers/admin.py", 
line 707, in 
  File "/home/gonguinguen/medios/gluon/globals.py", line 421, in 
self._caller = lambda f: f()
  File "/home/gonguinguen/medios/applications/webmedios/controllers/admin.py", 
line 704, in test
admin_password_sitio='93c824d1-91c4-428f-8542-db5db9d4594b')
  File "/home/gonguinguen/medios/applications/webmedios/controllers/admin.py", 
line 695, in instalar_demo_contenido
r = server.add_content(data)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1591, in __request
verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1306, in single_request
return self.parse_response(response)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1482, in parse_response
return u.close()
  File "/usr/lib64/python2.7/xmlrpclib.py", line 794, in close
raise Fault(**self._stack[0])
Fault: :'ascii' codec can't 
encode character u'\\xe1' in position 1: ordinal not in range(128)">



To make it work, I need to reload sys and set default encoding in the 
add_content() method of the webservice:

def add_content(data):
import sys
reload(sys)
sys.setdefaultencoding('utf8')
db.content.insert(
title=data.get('title'),
detail=data.get('detail')
)
return {'success': True}


After that, it works ok.
But here is the weird part: after having made one successfull call to the 
webservice method, I can remove the lines where I reload the sys, and it 
keeps working ok. But if I reload uwsgi, it starts throwing error again.

Anyway, I've read that reloading sys is not a good practise at all. So I'm 
pretty lost. I presumed that I could add "# -*- coding: utf-8 -*-" and 
forget about the encoding problems. 

What should I do?


-- 
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/584c8981-b4cd-4fe9-9b46-289a68a67d42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: set variable on models or modules

2019-07-04 Thread Val K
It seems  that defining db=DAL(...) at module level is not  a good idea  
http://www.web2py.com/books/default/chapter/29/04/the-core#Accessing-the-API-from-Python-modules


On Thursday, July 4, 2019 at 10:23:43 PM UTC+3, 黄祥 wrote:
>
> is there any difference to set variable on models or modules ?
> *e.g.*
> *models/db_connect.py*
> db = DAL('sqlite://test.sqlite', pool_size = 1)
>
> *modules/db_connect.py*
> from gluon.dal import DAL
> from gluon import current
> db = DAL('sqlite://test.sqlite', pool_size = 1)
> cache = current.cache
> cache_time_expire = 10
> cache_model = cache.ram # cache.ram, cache.disk, cache.memcache, 
> cache.redis
> cache_db = (cache_model, cache_time_expire)
>
> *controllers/install.py*
> import db_connect
> def index():
> db = db_connect.db
> db_schema_1_address.define(db = db)
> address_id_1 = db.address.insert(street = 'a', zip_code = '1', city = 
> 'a', country = 'a')
>
> *controllers/api.py*
> import db_connect
> #db = db_connect.db # not worked, must use from models/db.py
> cache_db = db_connect.cache_db # this variable can be used from modules, 
> no error occured
> db_schema_1_address.define(db = db)
>
> def response_json_rows():
> if not request.env.request_method == 'GET': raise HTTP(403)
> table_name = request.args(0)
> id = request.args(1)
> if id.isdigit() and int(id) > 0:
> query = (db[table_name]['id'] == id)
> else:
> query = (db[table_name]['id'] > 0)
> rows = db(query).select(orderby = ~db[table_name]['id'], 
> cache = cache_db, 
> cacheable = True)
> return response.json(rows)
>
> Traceback (most recent call last):
>   File "/Users/sugizo/learn/python/web2py/gluon/restricted.py", line 219, 
> in restricted
> exec(ccode, environment)
>   File 
> "/Users/sugizo/learn/python/web2py/applications/test/controllers/api.py", 
> line 24, in 
> db_schema_1_address.define(db = db)
>   File "applications/test/modules/db_schema_1_address.py", line 64, in 
> define
> format = lambda r: \
>   File 
> "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/base.py", 
> line 581, in define_table
> raise SyntaxError('table already defined: %s' % tablename)
> SyntaxError: table already defined: address
>
> any ideas ?
> intention is to move define tables from models into modules and load it on 
> controller when it's required, with minimal effort
>
> thx n 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/ba2b0514-ab49-4f3d-8c6c-255ce29e61ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: TypeError: object of type 'Field' has no len()

2019-07-04 Thread 黄祥
already tried define length on field constructor and change web server, 
because error above refer to rocket.py, so try gevent an error occured too
*modules/table_test.py*
test = db.define_table('test', 
Field('test', *length **= 255*), 
on_define = on_define_test)

$ python ~/learn/python/web2py/anyserver.py -s gevent -i 0.0.0.0 -p 8000
starting gevent on 0.0.0.0:8000...
Traceback (most recent call last):
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 976, in handle_one_response
self.run_application()
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 924, in run_application
self.process_result()
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 910, in process_result
self.write(data)
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 757, in write
self._write_with_headers(data)
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 778, in _write_with_headers
self._write(data)
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 733, in _write
header_str = b'%x\r\n' % len(data)
TypeError: object of type 'Field' has no len()
2019-07-03T10:07:08Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '63729', 
'HTTP_HOST': 'localhost:8000', (hidden keys: 28)} failed with TypeError

btw, anyserver.py can't run with gunicorn on 2.18.5-stable (no error 
occured, but the server can't been access in web browser
$ python ~/learn/python/web2py/anyserver.py -s gunicorn -i 0.0.0.0 -p 8000
starting gunicorn on 0.0.0.0:8000... 
[2019-07-03 17:01:19 +0700] [71683] [INFO] Starting gunicorn 19.9.0 
[2019-07-03 17:01:19 +0700] [71683] [INFO] Listening at: http://0.0.0.0:8000 
(71683) 
[2019-07-03 17:01:19 +0700] [71683] [INFO] Using worker: sync 
[2019-07-03 17:01:19 +0700] [71687] [INFO] Booting worker with pid: 71687


any way out ?

thx n 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/a87f8d07-e334-480a-a083-88769bb933e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Remove some title

2019-07-04 Thread Gopal Hirpara
Yes I do that..

On Mon, 1 Jul 2019, 11:50 am HTML,  wrote:

> Hello i would like to remove that index title from my page i wanted a
> blank page just with the menu how can i do that ?
>
> --
> 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/022fdb39-c0ec-46ac-8b31-5606262e6a04%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/CABQ7Wx-Xftc9wyUwzt7DE4O%2Bb4Vb-JuwSH%3Dd9bFmVyvKs1OjJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.18.5 is OUT

2019-07-04 Thread 黄祥
already tried define the length on field constructor and change web server 
because error above refer to rocket.py
*ref:*
https://groups.google.com/d/msg/web2py/2B9B9o151II/UyfREFmlBgAJ

*modules/table_test.py*
test = db.define_table('test', 
Field('test', length = 255), 
on_define = on_define_test)

$ python ~/learn/python/web2py/anyserver.py -s gevent -i 0.0.0.0 -p 8000
starting gevent on 0.0.0.0:8000...
Traceback (most recent call last):
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 976, in handle_one_response
self.run_application()
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 924, in run_application
self.process_result()
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 910, in process_result
self.write(data)
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 757, in write
self._write_with_headers(data)
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 778, in _write_with_headers
self._write(data)
  File 
"/Users/sugizo/miniconda3/envs/python3_test/lib/python3.7/site-packages/gevent/pywsgi.py"
, line 733, in _write
header_str = b'%x\r\n' % len(data)
TypeError: object of type 'Field' has no len()
2019-07-03T10:07:08Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '63729', 
'HTTP_HOST': 'localhost:8000', (hidden keys: 28)} failed with TypeError

btw, anyserver.py cant run gunicorn in 2.18.5, no error occured on 
terminal, but cant be access on browser

$ python ~/learn/python/web2py/anyserver.py -s gunicorn -i 0.0.0.0 -p 8000
starting gunicorn on 0.0.0.0:8000...
[2019-07-03 17:01:19 +0700] [71683] [INFO] Starting gunicorn 19.9.0
[2019-07-03 17:01:19 +0700] [71683] [INFO] Listening at: http://0.0.0.0:8000 
(71683)
[2019-07-03 17:01:19 +0700] [71683] [INFO] Using worker: sync
[2019-07-03 17:01:19 +0700] [71687] [INFO] Booting worker with pid: 71687

any way out ?

thx n 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/40c55b2d-0a29-420d-9453-bcf701dbb009%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: accessing a function in another controller

2019-07-04 Thread Massimo Di Pierro
maybe. I can tell you it is a challenge. :-)

On Thursday, 16 May 2019 09:52:55 UTC-7, Vlad wrote:
>
> web2py is so amazingly great that the only excuse to come up with web3py 
> is if it's going to be much better than web2py, if such a thing is 
> possible:)
>
> On Thu, May 16, 2019 at 11:35 AM Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> This is why we are making web3py. controllers are not regular modules in 
>> web2py. 
>>
>> On Wednesday, 15 May 2019 18:35:41 UTC-7, Dave S wrote:
>>>
>>>
>>>
>>> On Wednesday, May 15, 2019 at 4:45:17 PM UTC-7, Vlad wrote:

 c1.py and c2.py are controllers. 
 c2 has a function f in it. 
 Can code in c1.py call the function f?

>>>
>>> If f is a function in the URL sense (that is, it is top level in c2.py, 
>>> and has no arguments, and the URL /.../appY/c2/f makes sense) you can 
>>> redirect to it.  I do not know, and have never tried, to call f directly, 
>>> but the py-dotted notation c2.f *might maybe* work, imports done 
>>> correctly.
>>> If f has arguments and isn't an endpoint, then it could be in a file 
>>> module/m1.py, and imported by c1 and c2, or the *might-maybe* could be 
>>> in play.
>>>
>>> That would depend, I suppose, on how the custom importer works.  It is 
>>> known to work for modules.
>>>
>>> /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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/LVQkZVfaoZM/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/1c6083f8-0d81-41dd-a83b-b1c8c40b59ee%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/3253b436-dcfd-44c7-a88c-7dd0192be211%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Which versions of GAE does Web2py Python 3.x support?

2019-07-04 Thread Massimo Di Pierro
Good question. This needs to be tested. I am not sure

On Wednesday, 29 May 2019 07:09:06 UTC-7, Carl Hunter Roach wrote:
>
> When Web2py first added GAE support live was pretty simple. Both supported 
> Python 2.x and GAE only had one edition.
>
> Now, GAE comes in Standard and Flexible Environment versions.
> The Standard supports Python 2.x and 3.x but their implementations differ 
> to each other.
>
> Does Web2py using Python 3.x support GAE?
> And if so, which GAE versions?
>

-- 
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/daf31da0-6ce3-49cf-b364-821c68533098%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Include javascript file in layout.html

2019-07-04 Thread Massimo Di Pierro
In general it is good practive to include JS at the end of the  tag. 
But what you have should work. Can you provide an example?


On Wednesday, 29 May 2019 16:41:41 UTC-7, Omicron VT wrote:
>
> I am trying to include Tabulator JS in layout.html but i can not make it 
> work.
>
> If I include the files in the head section of view it works OK. 
>
> But if I include them on the head section of layout.html and then in view 
> i use extend 'layout.html' it can not find it.
>
> In sure is me, but i can not figure out.
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/754bedef-4a44-467c-8139-8cda65b6e431%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: My first template for web2py

2019-07-04 Thread Massimo Di Pierro
I think it is a great idea but do it work web3py. ;-)

On Thursday, 30 May 2019 00:35:52 UTC-7, Mohammad Rostami wrote:
>
> Hello. I hope that you will be happy and happy as usual. I love Python and 
> design. Because of this, I love web2py very much. I'm on the way to 
> learning web2py and design with html and css. 
>
> I designed the first template for the Web2py. What do you think of this 
> template?
>
> Truly, I want to create a site to share the templates that I design, with 
> friends. I still did not implement the idea. 
> Do you think this site is welcome?
> Do many users use web2py?
>  Is the web2py away from its peak?
>
> I'm glad to share with me what you think about this idea. 
>

-- 
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/04837711-4c83-4b98-8ab7-9dfe2bbc11ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: ignore_common filters not applied to left join table

2019-07-04 Thread Massimo Di Pierro
It is a bug. Can you please open a pydal ticket about this?

On Monday, 3 June 2019 05:58:42 UTC-7, icodk wrote:
>
> Not sure if it is a bug, feature or inconsistancy but ignore_common 
> filters not applied to left join table in query with left join.
> I would expect that ignore is for all.
> Not a big issue because you can set the commonfilter on the respected 
> tables to None just before query execution.
>

-- 
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/ae87c1ad-1e76-4e00-ac5d-e48c39ee461e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Display a list in SQLFORM.grid

2019-07-04 Thread Massimo Di Pierro
Can you explain more in detail what you want to do?

On Tuesday, 11 June 2019 14:16:36 UTC-7, Quang Lam wrote:
>
> how could i wrap a list and display it into SQLFORM.grid  to ensure there 
> is no characters in the list truncated when displayed 
> Please help
>

-- 
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/e307457a-351a-4542-8d24-31d73c9ef925%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: making a secure db connection on top of already existing SSL for the site

2019-07-04 Thread Massimo Di Pierro
Yes if the database is not on the same physical machine or if the machine 
is not exclusively under your control.
The connection with the clients is different from the connection of the 
server with the database.

On Saturday, 15 June 2019 22:54:56 UTC-7, Vlad wrote:
>
> Here is a quote from the web2py docs: 
>
> "Making a secure connection
> Sometimes it is necessary (and advised) to connect to your database using 
> secure connection, especially if your database is not on the same server as 
> your application. In this case you need to pass additional parameters to 
> the database driver. You should refer to database driver documentation for 
> details.
> For PostgreSQL with psycopg2 it should look like this:
> DAL('postgres://user_name:user_password@server_addr/db_name',
> driver_args={'sslmode': 'require', 'sslrootcert': 'root.crt',
>  'sslcert': 'postgresql.crt', 'sslkey': 'postgresql.key'})"
> <>
>
> I am wondering if this feature is still necessary for a secure db 
> connection in case I anyway use SSL for the site. 
>
> Does this secure postgres feature need to be used on top of existing SSL 
> connection? Or it's rather for non-ssl site to make a db connection secure? 
>

-- 
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/e895a870-df52-45d7-8afa-6c49cb52444c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.