Re: [web2py] Re: web3py again....

2019-03-30 Thread 黄祥
on github : - request, response objects are from bottle ( https://bottlepy.org/docs/dev/) what is different web2py and bottle in terms of request and response ? plus minus between it? - unlike web2py, web3py does not use custom import or eval is custom import is same like import from

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread João Matos
I used your widget=lambda f, v: SQLFORM.widgets.string.widget(f, v, _readonly=True) suggestion. I don't see any advantage in using the fields parameter because the change I found form.element('#no_table_sn')['_readonly'] = 'readonly' and the suggestion you made widget=lambda f, v: SQLFORM.widget

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread Anthony
> > I don't see any advantage in using the fields parameter because the change > I found > form.element('#no_table_sn')['_readonly'] = 'readonly' > and the suggestion you made > widget=lambda f, v: SQLFORM.widgets.string.widget(f, v, _readonly=True) > only change 1 line, and using the fields wou

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread João Matos
How can I use the fields argument without a db? I tried fields=['sn'] but it returns an KeyError. sábado, 30 de Março de 2019 às 18:27:11 UTC, Anthony escreveu: > > I don't see any advantage in using the fields parameter because the change >> I found >> form.element('#no_table_sn')['_readonly']

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread Anthony
Hard to say without seeing your code, but it definitely works for me. On Saturday, March 30, 2019 at 2:37:27 PM UTC-4, João Matos wrote: > > How can I use the fields argument without a db? > I tried > fields=['sn'] > but it returns an KeyError. > > > sábado, 30 de Março de 2019 às 18:27:11 UTC, An

[web2py] Anyone has web2py running with Python 3.7 and IIS 8? I'm unable to make it work.

2019-03-30 Thread João Matos
Hello, Anyone has web2py running with Python 3.7 and IIS 8? I'm unable to make it work. Thanks, JM -- 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

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread João Matos
This is my code form = SQLFORM.factory( Field('equipment_id', label=T('Equipment'), requires=IS_IN_SET({wo.equipment_id: db.equipment(wo. equipment_id).name}, zero=None), ), Field('sn', label=T('S

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread Jim Steil
Just change it to Field('sn', label=T('SN'), writable=False) Doesn't that work? Jim On Sat, Mar 30, 2019, 2:31 PM João Matos wrote: > This is my code > form = SQLFORM.factory( > Field('equipment_id', > label=T('Equipment'), > requires=IS_IN_SET({wo.

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread João Matos
No, it doesn't. It simply doesn't show the field. sábado, 30 de Março de 2019 às 19:43:46 UTC, Jim S escreveu: > > Just change it to > > Field('sn', label=T('SN'), writable=False) > > Doesn't that work? > > > Jim > > > > > On Sat, Mar 30, 2019, 2:31 PM João Matos > > wrote: > >> This is my code

Re: [web2py] Re: web3py again....

2019-03-30 Thread 黄祥
*step* rm -rf ~/learn/python/web3py cd ~/learn/python git clone https://github.com/web2py/web3py cd web3py cp -r applications/todo applications/todoo python web3py.py applications/ *result on browser* Error: 404 Not Found Sorry, the requested URL 'http://localhost:8000/todoo' caused an error: No

Re: [web2py] Re: How to add a read-only field to a SQLFORM.factory

2019-03-30 Thread Anthony
Need to see the code that generated the KeyError, as well as the full traceback, and details about how/when the error was generated. On Saturday, March 30, 2019 at 3:31:41 PM UTC-4, João Matos wrote: > > This is my code > form = SQLFORM.factory( > Field('equipment_id', >

Re: [web2py] web3py again....

2019-03-30 Thread Carlos Cesar Caballero Díaz
So far looks good, but I would prefer that the application include (or import) the framework instead of the framework include the application. With the first one, pip based deployments and CI/CD will be a lot easier. I have being playing with bottle a lot recently, so if there is some web3py f

Re: [web2py] Re: web3py again....

2019-03-30 Thread Massimo Di Pierro
On Saturday, 30 March 2019 02:26:22 UTC-7, 黄祥 wrote: > > on github : > >- request, response objects are from bottle ( >https://bottlepy.org/docs/dev/) > > what is different web2py and bottle in terms of request and response ? > plus minus between it? > slightly different syntax. bottle

[web2py] how to add users to existing programmatically using an if statement

2019-03-30 Thread J-mic
I have two groups and I would like to add users to those groups; the groups are Manager and Assistant. def adminAdd(): assistant = request.vars.assistant manager = request.vars.manager if assistant==manager: user = auth.register_bare( email=email

[web2py] web3py again....

2019-03-30 Thread Christopher Smiga
Hi Massimo and Team, It's been a several years since contributing to the project, and I'm interested in web3py for several reasons such as * it is a fresh project * speed * architecture improvements * the future of web2py In this effort, are pyunit (TDD), Python Behave Library (

Re: [web2py] Re: web3py again....

2019-03-30 Thread Massimo Di Pierro
Try http://localhost:8000/todoo /index On Saturday, 30 March 2019 19:50:57 UTC-7, 黄祥 wrote: > > *step* > rm -rf ~/learn/python/web3py > cd ~/learn/python > git clone https://git

Re: [web2py] web3py again....

2019-03-30 Thread Massimo Di Pierro
Nope! If that is what you do, just use bottle. The whole point of web2py (which I am trying to preserve in web3py) is that the framework can run whether or not you have an application and multiple applications can be installed in a plug-and-play fashion. This means it is not logically possible f

[web2py] Re: web3py again....

2019-03-30 Thread Massimo Di Pierro
I am trying to keep it intentionally small and the API may change. For example I am going to refactor some of the decorators as bottle plugins. About your questions. we will continue use travis-ci like we do with web3py. I like behave but may people I talked too found it hard to learn and that i