Re: [web2py] Re: Web3py

2019-04-20 Thread 黄祥
scaffolding app would be nice to have example of authentication (user 
registration, login and logout) and to update the data, e.g. update todo 
list on todo app
just wondering, if form used manually using javascript, is the field 
validation on pydal, still can work ? e.g. requires=IS_NOT_EMPTY()

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.


Re: [web2py] Re: Web3py

2019-04-20 Thread Massimo Di Pierro
I have been looking more into veutify. I have some reservations.
I think a good CSS framework (for web3py) should be JS agnostic, even if 
the examples use vue.js. 
I think effects should be done in CSS only, not in JS. vuetify does not 
follow this rule.
Also vuetify is really designed for use with the CLI and I would like 
web3py to remain CLI agnostic.
Documentation is not good yet.
I think I will stick to bulma for now for the simplest example apps and 
dashboard.

For mobile app style, I like Framework7 a lot.

Massimo

On Wednesday, 17 April 2019 21:31:48 UTC-7, Massimo Di Pierro wrote:
>
> Ignorance on my side. If you want to make a PR switching to vuetify I will 
> accept it.
>
>
> On Wednesday, 17 April 2019 02:17:49 UTC-7, Ramos wrote:
>>
>> Massimo , any reason you chose Bulma instead of vuetify ?
>> Vuetify is designed specifically for vuejs 
>> Regards
>> António
>>
>> Em qua, 17 de abr de 2019 às 09:37, António Ramos  
>> escreveu:
>>
>>> Worked for me...
>>>
>>>
>>> Em ter, 16 de abr de 2019 às 21:32, En Ware  
>>> escreveu:
>>>
 Thank you , that did it.

 On Tuesday, April 16, 2019 at 2:42:40 PM UTC-5, Massimo Di Pierro wrote:
>
> You have an old pydal. Do
>
> pip3 install --upgrade pydal
>
> Also do
>
> python3 web3py.py applications
>
> Not
>
> python3 web3py.py applications/todo/
>
> -- 
 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: Web3py

2019-04-20 Thread Massimo Di Pierro
If you made use of SQLHTML forms and grid and simply want to move from 
python2 to python3, than stick with web2py.

If you want to use the DAL and maybe web2py templates but your app is (or 
will be) using mostly API driven then use web3py.

web3py already supports tickets (like web2py), pydal, yatl, helpers (almost 
identical to web2py), multi app (applications folder), and will soon have a 
functioning _dashboard (with similar functionalities to web2py's 
admin+appadmin). You will be able to develop and deploy and manage apps 
very much like you do in web2py. What we will not do, is encourage the use 
of server side rendering of forms and grids with postbacks logic that 
web2py has. We will instead create more tools to make API based apps easier 
to build with minimal JS programming. web3py will be less opinionated on 
the server but more opinionated on the client. It will not force you to use 
any client specific JS but default apps will ship with vue.js and examples 
based on vue.js.

The goal is the same "make web development easy and enforce good practices" 
but the web has changed since 2007, when web2py was designed.

Massimo


On Saturday, 20 April 2019 14:44:39 UTC-7, Jacinto Parga wrote:
>
> So, if you plan to move your web services developed with web2py python 2.7 
> to python 3 and deploy new micro services, what would be the best choice to 
> try?
>  - web2py for python 3
>  - web3py
>  
>  Let's suppose one year term
>
> El sábado, 20 de abril de 2019, 22:45:55 (UTC+2), 黄祥 escribió:
>>
>> is it on same situation web2py for python 3 vs web3py
>> with
>> laravel vs lumen
>> ?
>> the first is full stack web framework, while the other is micro web 
>> framework
>>
>> 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: SQLFORM.smartgrid selectable return string or list

2019-04-20 Thread Anthony
On Saturday, April 20, 2019 at 8:52:01 AM UTC-4, icodk wrote:
>
> Hi Antony
>
> My selectable looks like :
>
> selectable = [('Add 100 to price',lambda ids: redirect(URL('product', 
> 'modify_price', args=request.args, vars=dict(id=ids, inc=100,
>
>
Why do a redirect rather than simply doing the work in the same function? 
Also, this redirect puts the ids in the URL query string, resulting in the 
ultimate update being a GET request rather than a POST -- this is 
undesirable because a refresh of that page will result in the entire 
operation being repeated, which you don't want.
 

>
> and my function in the product controller looks like this:
>
> def modify_price():
>
> if type(request.vars.id) is str:
>
> id_list = request.vars.id.split(',') #convertint to list
>
> else:
>
> id_list = request.vars.id
>
> db(db.product.id.belongs(id_list)).update(product_price=db.product.product_price+request.vars.inc)
>
>
>  Simply following the documentation in the book
>
> I also tried:
>
> selectable=  lambda ids: modify_price
>
>
> But the function neve called
>

It's not that the function never gets called but that the function is not 
written to work this way. The function expects to find ids in 
request.vars.id, but that is actually None in the case where you call it 
this way (the real values are in request.vars.records). Is modify_price a 
controller action that needs to be accessible separately from this 
particular operation? If not, just make it a helper function that accepts 
an "ids" argument, and set selectable=modify_price.

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] Re: Unable to edit grid record if I add @auth.requires_signature() to action. Is this normal?

2019-04-20 Thread Massimo Di Pierro
It is intentional. The grid requires a valid user to make field editable. 
You can override this with:

grid(..., user_signature=False)

In any case if the user is not logged if you tables require a user 
signature, those fields will not be automatically filled.

On Saturday, 20 April 2019 13:03:17 UTC-7, João Matos wrote:
>
> If I replace @auth_requires_login() with @auth.requires_signature() to my 
> index function (controller's main function) where a grid is created, the 
> grid shows up without any issue, but if I try to edit a row, I get a Not 
> Authorized message.
>
> Anyone has any idea why this is happening?
>
> If I replace @auth.requires_signature() with @auth.requires_login() 
> everything works.
>

-- 
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: Web3py

2019-04-20 Thread Anthony
On Friday, April 19, 2019 at 6:41:34 PM UTC-4, Carlos Cesar Caballero wrote:
>
> Well, that's a really fair concern, I was just mentioning, because I like 
> ORMs and other popular projects like SQLAlchemy includes a DAL (they call 
> it SQL abstraction toolkit) and an ORM on top of it, and if you look at 
> popular web development full stack frameworks, almost all of them are 
> relaying their models to ORMs.
>

The SQLAlchemy ORM adds a lot of functionality that is not available with 
its DAL alone, and most of that extra functionality already exists in 
pyDAL. As far as I can tell, the weppy ORM does not really add any 
functionality to the DAL -- it is mostly an alternative syntax. I'm not 
saying there isn't value there, just that it is a lot of code maintenance 
to take on for maybe only a very modest benefit.

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.


Re: [web2py] Re: Web3py

2019-04-20 Thread Anthony
On Friday, April 19, 2019 at 5:47:31 PM UTC-4, Carlos Cesar Caballero wrote:
>
> Yes, but that's not about the number of code lines, that's about the code 
> organization and readability.
>

At least with the example given, I don't see a lot of difference in 
organization or readability (particularly not enough to warrant 
introduction of the ORM codebase as well as the confusion that can come 
with having multiple ways to do the same thing).

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] Re: Web3py

2019-04-20 Thread Jacinto Parga
So, if you plan to move your web services developed with web2py python 2.7 
to python 3 and deploy new micro services, what would be the best choice to 
try?
 - web2py for python 3
 - web3py
 
 Let's suppose one year term

El sábado, 20 de abril de 2019, 22:45:55 (UTC+2), 黄祥 escribió:
>
> is it on same situation web2py for python 3 vs web3py
> with
> laravel vs lumen
> ?
> the first is full stack web framework, while the other is micro web 
> framework
>
> 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.


Re: [web2py] Re: Web2py binaries

2019-04-20 Thread Nico Zanferrari
Ciao Massimo,

I've tried today to build the Windows version with python 2.7 - but it's
not so easy as I thought. I'll let you know ...

nico



Il giorno sab 20 apr 2019 alle ore 17:24 Massimo Di Pierro <
massimo.dipie...@gmail.com> ha scritto:

> Can you point me to a version OSX and WIN for python 2.7?
>
> On Friday, 19 April 2019 01:16:29 UTC-7, Nico Zanferrari wrote:
>>
>> Thanks for testing, Dave, I'm happy to hear that it's working fine!
>>
>> I think that the Welcome app with latest web2py versions don't look so
>> fine in Windows and python 3, but I cannot see any difference from running
>> it from sources. Let me know if I'm wrong or there are anything else.
>>
>> Nico
>>
>> Il giorno gio 18 apr 2019 alle ore 10:59 Dave S 
>> ha scritto:
>>
>>>
>>>
>>> On Thursday, April 18, 2019 at 12:48:04 AM UTC-7, Dave S wrote:



 On Sunday, April 14, 2019 at 1:28:30 PM UTC-7, Nico Zanferrari wrote:
>
> Hi all,
>
> I've  just updated the experimental binaries for MacOs and Windows to
> the latest web2py version (2.18.5) on
> https://github.com/nicozanf/web2py-pyinstaller . They now contain
> python 3.7.3 64 bit. Also, the web2py sources inside the ZIP is now
> replaceble with newer web2py versions when needed ;-)
>
> There is only a problem with the APP version of MacOs binaries, that
> is not working due to this PyInstaller bug
> . But the
> MacOs command version works fine.
>
>
> Please, help my work by testing them!
>
>
> Cheers,
> Nico
>
>

  I sent email per the README, but copying the group here:

 Stage 1:  installation -- pass
 Stage 2:  Welcome App -- seems to be problems with CSS, especially in
 the navigation bar.  Each menu shows up, but in faint blue on white, small
 font, and the pull-downs wrap instead of item-per-line.
 Admin App -- seems to work fine in early testing.
 Stage 3:  Port one of my apps -- pending.


>>> One of my simpler apps is mostly working, after a hasty pounding of
>>> print statements ("#", rather than "(" and ")" ).  I got a ticket for a
>>> sort() that wasn't an attribute of the dict-like thingy I was interested
>>> in.  That's a five minute test, but it included some SQLFORMs, and a custom
>>> validator.  I cheated and used my old static folder at this point.
>>>
>>> /dps
>>>
>>>
>>>
>>>
 Chrome: Version 73.0.3683.103 (Official Build) (64-bit)
 Windows 10 Pro build number 17763


 Il giorno lun 18 mar 2019 alle ore 03:42 Massimo Di Pierro <
> massimo...@gmail.com> ha scritto:
>
>> Fantastic. Will process this within the week and make it the new
>> default.
>>
>> On Friday, 15 March 2019 07:55:16 UTC-7, Nico Zanferrari wrote:
>>>
>>> Hi all,
>>>
>>> I've was successful in making the experimental Mac app, too, with
>>> python3. Grab it from https://github.com/nicozanf/web2py-pyinstaller
>>> , where there are also all the instructions in order to build it by
>>> yourself ;-)
>>>
>>> A private feedback is appreciated.
>>>
>>> Nico
>>>
>>> Il giorno ven 15 mar 2019 alle ore 04:56 Massimo Di Pierro <
>>> massimo...@gmail.com> ha scritto:
>>>
 The official version is currently broken.

 On Wednesday, 13 March 2019 15:53:09 UTC-7, Nico Zanferrari wrote:
>
> Hi,
>
> I've just updated the experimental Windows binary version with
> python 3.7.2 to web2py 2.18.4 . Also, now there is in addition the
> no_console binary and there is the python-ldap module included. Grab 
> it
> from https://github.com/nicozanf/web2py-pyinstaller : please test
> it and give me a feedback.
>
> I'm still playing with the Mac version. Could someone confirm that
> the current official binary version is really working? After typing 
> the
> password I've got the error 'module object has no attribute pbkdf2 
> hmac' -
> maybe for the python version included. According to this
> 
>  it
> should have at least 2.7.8 but it seems with 2.7.3.
>
> Cheers,
> Nico
>
 --
 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 web...@googlegroups.com.
 For more options, visit https://groups.google.com/d/op

[web2py] Re: SQLFORM.smartgrid selectable return string or list

2019-04-20 Thread villas
Hi Icodk

I would see exactly what is being submitted by the browser. Open the 'web 
developer' section in your browser and look at the 'network' traffic.  When 
you click your submit button, see what variables etc are being sent.

If your function is really being called, then try some print statements to 
see what is being received by the function (you seem to be doing that).

Or, I guess you can also call your function directly from the lambda.  
...
selectable= (lambda ids: modify_price(ids, 100)),
...

def modify_price(ids, incr):
#print ids, incr
db(db.product.id.belongs(ids)).update(

product_price=db.product.product_price + incr)






On Saturday, 20 April 2019 13:52:01 UTC+1, icodk wrote:
>
> Hi Antony
>
> My selectable looks like :
>
> selectable = [('Add 100 to price',lambda ids: redirect(URL('product', 
> 'modify_price', args=request.args, vars=dict(id=ids, inc=100,
>
>
> and my function in the product controller looks like this:
>
> def modify_price():
>
> if type(request.vars.id) is str:
>
> id_list = request.vars.id.split(',') #convertint to list
>
> else:
>
> id_list = request.vars.id
>
> db(db.product.id.belongs(id_list)).update(product_price=db.product.product_price+request.vars.inc)
>
>
>  Simply following the documentation in the book
>
> I also tried:
>
> selectable=  lambda ids: modify_price
>
>
> But the function neve called
>
> It should be request.vars.records, not request.vars.id.
>
>
> Also tried with 
>
> def modify_rule_end_time():
>
> print request.vars.records 
>
>
> and 
>
> def modify_rule_end_time(ids):
>
> print ids
>
> But again no error and the function was not called
>
> On Friday, April 19, 2019 at 9:39:51 PM UTC+2, Anthony wrote:
>>
>> It should be request.vars.records, not request.vars.id.
>>
>> Note, request.vars is processed by the core framework, not by 
>> SQLFORM.smartgrid, so it will be a single value if the browser sends only 
>> one "records" field in the form data and a list otherwise. The core code 
>> that populates request.vars has no way of knowing that a given field 
>> containing a single value is supposed to be a list -- that has to be 
>> handled elsewhere. SQLFORM.smartgrid itself handles this properly, but if 
>> you are going to intercept request.vars and run some custom code outside of 
>> the grid, then it is up to you to do the check and convert to a list.
>>
>> Keep in mind, the "selectable" argument to the grid should be a function 
>> that takes the list of ids -- presumably you can move your code into that 
>> function, in which case, you won't have to worry about this, as the grid 
>> will handle the conversion to a list.
>>
>> Anthony
>>
>> On Friday, April 19, 2019 at 9:28:21 AM UTC-4, icodk wrote:
>>>
>>> SQLFORM.smartgrid selectable  return string if only one checkbox was 
>>> slected and returns a list if 2 or more was selected.
>>> This  inconsitancy force me to check for type before processing can 
>>> continue
>>> For example, If I have a button that update selected records in the 
>>> database call a function that do:
>>>
>>>
>>> db(db.product.id.belongs(request.vars.id)).update(price=db.product.price+request.vars.inc_price)
>>>
>>>
>>> However if only one line selected in the grid request.vars.id is a string 
>>> and not a list, which cause an error
>>>
>>>

-- 
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: Web3py

2019-04-20 Thread 黄祥
is it on same situation web2py for python 3 vs web3py
with
laravel vs lumen
?
the first is full stack web framework, while the other is micro web 
framework

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] Unable to edit grid record if I add @auth.requires_signature() to action. Is this normal?

2019-04-20 Thread João Matos

If I replace @auth_requires_login() with @auth.requires_signature() to my 
index function (controller's main function) where a grid is created, the 
grid shows up without any issue, but if I try to edit a row, I get a Not 
Authorized message.

Anyone has any idea why this is happening?

If I replace @auth.requires_signature() with @auth.requires_login() 
everything works.

-- 
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: Web3py

2019-04-20 Thread Massimo Di Pierro
web2.py existed before web2py and did not hurt us.
web3py existed before web3.py and in fact I own the domain name. It will 
not hurt us either.

I am more concerned by the confusion between web2py for python 3 vs web3py.
I am thinking it should have two names "web3py XYZ" where XYZ is t.b.d.

On Thursday, 18 April 2019 04:26:59 UTC-7, Kevin Keller wrote:

> Yeah saw that too.
>
> I agree it's worthwhile to go for a different name eventually. 
>
>

-- 
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: Web2py binaries

2019-04-20 Thread Massimo Di Pierro
Can you point me to a version OSX and WIN for python 2.7?

On Friday, 19 April 2019 01:16:29 UTC-7, Nico Zanferrari wrote:
>
> Thanks for testing, Dave, I'm happy to hear that it's working fine!
>
> I think that the Welcome app with latest web2py versions don't look so 
> fine in Windows and python 3, but I cannot see any difference from running 
> it from sources. Let me know if I'm wrong or there are anything else.
>
> Nico
>
> Il giorno gio 18 apr 2019 alle ore 10:59 Dave S  
> ha scritto:
>
>>
>>
>> On Thursday, April 18, 2019 at 12:48:04 AM UTC-7, Dave S wrote:
>>>
>>>
>>>
>>> On Sunday, April 14, 2019 at 1:28:30 PM UTC-7, Nico Zanferrari wrote:

 Hi all,

 I've  just updated the experimental binaries for MacOs and Windows to  
 the latest web2py version (2.18.5) on 
 https://github.com/nicozanf/web2py-pyinstaller . They now contain 
 python 3.7.3 64 bit. Also, the web2py sources inside the ZIP is now 
 replaceble with newer web2py versions when needed ;-)

 There is only a problem with the APP version of MacOs binaries, that is 
 not working due to this PyInstaller bug 
 . But the 
 MacOs command version works fine.


 Please, help my work by testing them! 


 Cheers,
 Nico  


>>>
>>>  I sent email per the README, but copying the group here:
>>>
>>> Stage 1:  installation -- pass
>>> Stage 2:  Welcome App -- seems to be problems with CSS, especially in 
>>> the navigation bar.  Each menu shows up, but in faint blue on white, small 
>>> font, and the pull-downs wrap instead of item-per-line.
>>> Admin App -- seems to work fine in early testing.
>>> Stage 3:  Port one of my apps -- pending.
>>>
>>>
>> One of my simpler apps is mostly working, after a hasty pounding of print 
>> statements ("#", rather than "(" and ")" ).  I got a ticket for a sort() 
>> that wasn't an attribute of the dict-like thingy I was interested in.  
>> That's a five minute test, but it included some SQLFORMs, and a custom 
>> validator.  I cheated and used my old static folder at this point.
>>
>> /dps
>>
>>
>>  
>>
>>> Chrome: Version 73.0.3683.103 (Official Build) (64-bit)
>>> Windows 10 Pro build number 17763
>>>
>>>
>>> Il giorno lun 18 mar 2019 alle ore 03:42 Massimo Di Pierro <
 massimo...@gmail.com> ha scritto:

> Fantastic. Will process this within the week and make it the new 
> default.
>
> On Friday, 15 March 2019 07:55:16 UTC-7, Nico Zanferrari wrote:
>>
>> Hi all,
>>
>> I've was successful in making the experimental Mac app, too, with 
>> python3. Grab it from https://github.com/nicozanf/web2py-pyinstaller  
>> , where there are also all the instructions in order to build it by 
>> yourself ;-)
>>
>> A private feedback is appreciated.
>>
>> Nico
>>
>> Il giorno ven 15 mar 2019 alle ore 04:56 Massimo Di Pierro <
>> massimo...@gmail.com> ha scritto:
>>
>>> The official version is currently broken.
>>>
>>> On Wednesday, 13 March 2019 15:53:09 UTC-7, Nico Zanferrari wrote:

 Hi,

 I've just updated the experimental Windows binary version with 
 python 3.7.2 to web2py 2.18.4 . Also, now there is in addition the 
 no_console binary and there is the python-ldap module included. Grab 
 it 
 from https://github.com/nicozanf/web2py-pyinstaller : please test 
 it and give me a feedback.

 I'm still playing with the Mac version. Could someone confirm that 
 the current official binary version is really working? After typing 
 the 
 password I've got the error 'module object has no attribute pbkdf2 
 hmac' - 
 maybe for the python version included. According to this  
 
  it 
 should have at least 2.7.8 but it seems with 2.7.3.

 Cheers,
 Nico

>>> -- 
>>> 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 web...@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 "w

[web2py] Re: SQLFORM.smartgrid selectable return string or list

2019-04-20 Thread icodk


Hi Antony

My selectable looks like :

selectable = [('Add 100 to price',lambda ids: redirect(URL('product', 
'modify_price', args=request.args, vars=dict(id=ids, inc=100,


and my function in the product controller looks like this:

def modify_price():

if type(request.vars.id) is str:

id_list = request.vars.id.split(',') #convertint to list

else:

id_list = request.vars.id

db(db.product.id.belongs(id_list)).update(product_price=db.product.product_price+request.vars.inc)


 Simply following the documentation in the book

I also tried:

selectable=  lambda ids: modify_price


But the function neve called

It should be request.vars.records, not request.vars.id.


Also tried with 

def modify_rule_end_time():

print request.vars.records 


and 

def modify_rule_end_time(ids):

print ids

But again no error and the function was not called

On Friday, April 19, 2019 at 9:39:51 PM UTC+2, Anthony wrote:
>
> It should be request.vars.records, not request.vars.id.
>
> Note, request.vars is processed by the core framework, not by 
> SQLFORM.smartgrid, so it will be a single value if the browser sends only 
> one "records" field in the form data and a list otherwise. The core code 
> that populates request.vars has no way of knowing that a given field 
> containing a single value is supposed to be a list -- that has to be 
> handled elsewhere. SQLFORM.smartgrid itself handles this properly, but if 
> you are going to intercept request.vars and run some custom code outside of 
> the grid, then it is up to you to do the check and convert to a list.
>
> Keep in mind, the "selectable" argument to the grid should be a function 
> that takes the list of ids -- presumably you can move your code into that 
> function, in which case, you won't have to worry about this, as the grid 
> will handle the conversion to a list.
>
> Anthony
>
> On Friday, April 19, 2019 at 9:28:21 AM UTC-4, icodk wrote:
>>
>> SQLFORM.smartgrid selectable  return string if only one checkbox was 
>> slected and returns a list if 2 or more was selected.
>> This  inconsitancy force me to check for type before processing can 
>> continue
>> For example, If I have a button that update selected records in the 
>> database call a function that do:
>>
>>
>> db(db.product.id.belongs(request.vars.id)).update(price=db.product.price+request.vars.inc_price)
>>
>>
>> However if only one line selected in the grid request.vars.id is a string 
>> and not a list, which cause an error
>>
>>

-- 
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: Web3py

2019-04-20 Thread villas
I've just been playing with web3py and I think it's great!  This framework 
seems so much cleaner and I like the Bottle routes etc.

Re: Dashboard. Currently broken, but I guess Massimo is still working on 
this and committed prematurely.

Re: ORM.  It feels like we are talking about the icing before the cake has 
been mixed. Hopefully any ORM would just be a plug-in option rather than 
weighing down our fantastic DAL.

Re: Auth.  This seems a much more important topic because I'm not going to 
bother making any app until I know how to secure it. This is one feature of 
web2py that is vital.  I'm really hoping too that any auth would include 
'roles' because 'authorization' depends on that. I hope this will attract 
more comments.

Re: Form. I know that we want to be agnostic, but there seems little harm 
to include basic styling classes. Could this be taken from a config file?  
Maybe Vuetify would be better than Bootstrap?

Re: Grid.  I use SQLFORM.grid for prototyping,  but I then I so often find 
myself replacing that code with Datatables. Shouldn't we just include 
Datatables?  It has everything we need - doesn't it?

Thanks to Massimo and others for making this great progress for our 
community!

-- 
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: Web3py

2019-04-20 Thread 黄祥
github latest commit
*access via browser *
http://localhost:8000/dashboard
*on console*
127.0.0.1 - - [20/Apr/2019 16:17:21] "GET /dashboard HTTP/1.1" 303 0
127.0.0.1 - - [20/Apr/2019 16:17:21] "GET /_dashboard/static/index.html 
HTTP/1.1" 404 460
127.0.0.1 - - [20/Apr/2019 16:17:26] "GET /_dashboard HTTP/1.1" 404 460

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.