[web2py] Re: How can I block logins from users with is_active == False?

2019-04-02 Thread João Matos
Found a solution

def check_if_user_is_active(form):
"""Check if user is active."""
if not db.auth_user(username=form.vars.username).is_active:
session.flash = T('That username is not active.')
redirect(URL('user', 'login'))


auth.settings.login_onvalidation.append(check_if_user_is_active)


Is there a better way?


quarta-feira, 3 de Abril de 2019 às 01:25:22 UTC+1, João Matos escreveu:
>
> Hello,
>
> How can I block logins from users with is_active == False?
>
> 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 received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How can I block logins from users with is_active == False?

2019-04-02 Thread João Matos
Hello,

How can I block logins from users with is_active == False?

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 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: How can I convert a SUM from a SQLite SELECT statement to web2py's DAL?

2019-04-02 Thread João Matos
The output from the SQLite statement is this

idusernamecanceled_oncanceled_byoperadorverificador   
 supervisor
4leitor 0   0  0
3operador   1   0  0
2supervisor 0   0  1
1teclalivre 0   0  1
5verificador0   1  0

The last 3 columns are the names of fixed group roles (translated are 
operator, checker and supervisor).

I have the SQLite statement working using a view (tip from ValK on another 
topic) and a web2py grid but I would like to not be dependent on SQLite and 
use the DAL.

I don't understand how I can add the SUM() () to the DAL.

Taking for example one of the SUM lines

SUM(auth_group.role = 'Operador') operador

How can I name the sum output column operador? I can't use the usual 
solution of using the headers parameter.


On the other hand, the example of the book doesn't apply to my use case, 
because I want the sum to depend on the user but I don't want to have to 
execute and store
sum_operator = db(db.auth_group.role == 'Operador').sum()
sum_checker = db(db.auth_group.role == 'Verificador').sum()
sum_supervisor = db(db.auth_group.role == 'Supervisor').sum()

for each user before calling this SELECT

query = db().select(
db.auth_user.id,
db.auth_user.username,
db.auth_user.canceled_on,
db.auth_user.canceled_by,
left=(
db.auth_membership.on(db.auth_user.id == db.auth_membership.user_id
),
db.auth_group.on(db.auth_group.id == db.auth_membership.group_id),
),
groupby=db.auth_user.username,
orderby=db.auth_user.username,
)


Any ideas?




terça-feira, 2 de Abril de 2019 às 10:41:31 UTC+1, Dave S escreveu:
>
>
>
> On Tuesday, April 2, 2019 at 12:45:04 AM UTC-7, João Matos wrote:
>>
>> I had already read it. Unfortunately it didn't help.
>>
>>
> Can you show what you tried with .sum() ?   Did you get errors, or did 
> you get a result that was unexpected?  What was the expected result?
>
> /dps
>
>
>> terça-feira, 2 de Abril de 2019 às 00:23:14 UTC+1, Scott Hunter escreveu:
>>>
>>> This part of the web2py book might help: 
>>> http://www.web2py.com/book/default/chapter/06#sum-avg-min-max-and-len
>>>
>>> On Monday, April 1, 2019 at 6:41:51 PM UTC-4, João Matos wrote:

 Hello,

 I have this SELECT in SQLite

 result = db.executesql(
 "SELECT auth_user.id, auth_user.username, "
 "auth_user.canceled_on, "
 "auth_user.canceled_by, "
 "SUM(auth_group.role = 'Operador') operador, "
 "SUM(auth_group.role = 'Verificador') verificador, "
 "SUM(auth_group.role = 'Supervisor') supervisor "
 "FROM auth_user "
 "LEFT JOIN auth_membership ON auth_user.id = 
 auth_membership.user_id "
 "LEFT JOIN auth_group ON auth_group.id = 
 auth_membership.group_id "
 "GROUP BY username ORDER BY username"
 )

 and would like to convert it to web2py's DAL.
 I made this

 query = db().select(
 db.auth_user.id,
 db.auth_user.username,
 db.auth_user.canceled_on,
 db.auth_user.canceled_by,
 left=(
 db.auth_membership.on(db.auth_user.id == db.auth_membership.
 user_id),
 db.auth_group.on(db.auth_group.id == db.auth_membership.
 group_id),
 ),
 groupby=db.auth_user.username,
 orderby=db.auth_user.username,
 )

 but I can't find any way to integrate the sums.

 Does anyone know how to do it?

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

2019-04-02 Thread John Underhill
I think all this bears some brainstorming in light of what’s going on with 
Webassembly.

I’m not saying Javascript for building web UIs isn’t the future, but...

Ok, quick show of hands: How many people absolutely adore Javascript?  Oh wait, 
it doesn’t matter, because we have no choice.  Or do we?

What if we could develop the whole app in Python, front end and back end?  What 
if we could develop front end apps for the browser in Python, with Web2py (or 
its successor)?  And they ran really fast, and integrated transparently with 
back-end services, also written in Python?

Not sure exactly what this would look like, but I’ve been pushing it around for 
a while.  At the very least this has the potential to make my life much easier. 
 We probably need some pieces that aren’t there yet (but probably they will be 
shortly).

What do you all think?

John


From: web2py@googlegroups.com on behalf of Carlos Costa 

Sent: Tuesday, April 2, 2019 2:09 PM
To: web2py-users
Subject: [web2py] Re: web3py again

Will it have default url routes?

beyond that,  my thought about ui widgets:
I think it would be nice:
1 - to have an easy integration via a model rest api
2- be agnostice to client side frameworks
3 - come with a default client side framework (preferably vue)
4 - have a ui lib by default
5 - have a template for building custom ui widgets using vue (like single page 
components or something.) that integrates easily,
maybe with some client api, with the server

Em quinta-feira, 28 de março de 2019 06:16:15 UTC-3, Massimo Di Pierro escreveu:
I know this comes up once in a while but ...

https://github.com/web2py/web3py

what do you think?

It is very preliminary but I will have an admin soon.
Backporting SQLFORM, grid and Auth, should not be that complicated, although I 
think we can do better.

Massimo


--
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/vLw9sj6nw7M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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


[web2py] Re: Is it possible to show the results from a SELECT (made with SQLite using db.executesql) in a grid?

2019-04-02 Thread João Matos
Thanks for the tip Anthony.
Is the purpose of the fake_migrate parameter only for the scenarios in the 
manual or are there any other uses for it?


terça-feira, 2 de Abril de 2019 às 16:52:45 UTC+1, Anthony escreveu:
>
> Note, you do not need to set fake_migrate, as long as migrate=False (the 
> DAL will simply ignore migrations for that table).
>
> On Tuesday, April 2, 2019 at 1:43:41 AM UTC-4, Val K wrote:
>>
>> Create view in sqlite "CREATE VIEW your_tbl_name AS SELECT ..." using 
>> executesql and define corresponding  web2py table with migrate=False, 
>> fake_migrate=True
>
>

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

2019-04-02 Thread Carlos Costa
Will it have default url routes?

beyond that,  my thought about ui widgets:
I think it would be nice:
1 - to have an easy integration via a model rest api
2- be agnostice to client side frameworks
3 - come with a default client side framework (preferably vue)
4 - have a ui lib by default
5 - have a template for building custom ui widgets using vue (like single 
page components or something.) that integrates easily, 
maybe with some client api, with the server

Em quinta-feira, 28 de março de 2019 06:16:15 UTC-3, Massimo Di Pierro 
escreveu:
>
> I know this comes up once in a while but ...
>
> https://github.com/web2py/web3py
>
> what do you think? 
>
> It is very preliminary but I will have an admin soon.
> Backporting SQLFORM, grid and Auth, should not be that complicated, 
> although I think we can do better.
>
> Massimo
>
>

-- 
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: Compressed bootstrap.min.css

2019-04-02 Thread Константин Комков
-- 
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: Is it possible to show the results from a SELECT (made with SQLite using db.executesql) in a grid?

2019-04-02 Thread Anthony
Note, you do not need to set fake_migrate, as long as migrate=False (the 
DAL will simply ignore migrations for that table).

On Tuesday, April 2, 2019 at 1:43:41 AM UTC-4, Val K wrote:
>
> Create view in sqlite "CREATE VIEW your_tbl_name AS SELECT ..." using 
> executesql and define corresponding  web2py table with migrate=False, 
> fake_migrate=True

-- 
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] pbkdf2_hmac error on PythonAnywhere

2019-04-02 Thread Philip Kilner
Since I asked the question, the ever-helpful Giles has popped up in the 
forum at PythonAnywhere, and he tells me that they work off images, and 
that mine was an old one - he's organising an update to the latest version, 
which takes Python to 2.7.12,

I suspect that if you are able to check your Python version, you will be at 
2.78 or later - I think I am the exception, by virtue of being on an older 
image.

--

P

-- 
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: Redis and Python3?

2019-04-02 Thread Jim S
Massimo - I've updated my change per your suggestion.  Also, I've made a 
pull request to get these changes merged.  This is my first time 
contributing (to any open source project) so please let me know if I messed 
something up.

-Jim

On Tuesday, April 2, 2019 at 1:31:10 AM UTC-5, Massimo Di Pierro wrote:
>
> we could change True/False with 1/0 but a better approach would be to 
> remove the value within the redis adapter. The value of locked does not do 
> anything anyway on redis since it is not a relational database with 
> transactions.
>
> On Sunday, 31 March 2019 10:19:20 UTC-7, Jim S wrote:
>>
>> I changed the following in gluon/globals.py and mine is working now.  
>> But, I'm unclear on how to test to see if it is handling the locking 
>> properly:
>>
>> dd = dict(locked=False,
>>   client_ip=response.session_client,
>>   modified_datetime=request.now,
>>   session_data=session_pickled,
>>   unique_key=unique_key)
>>
>> to 
>>
>> dd = dict(locked='False',
>>   client_ip=response.session_client,
>>   modified_datetime=str(request.now),
>>   session_data=session_pickled,
>>   unique_key=unique_key)
>>
>> This makes all my stuff work (I'm still on Python 2.7 but I think the 
>> problem has to do with the python redis client moving to version 3).
>>
>> Leonel - I think this relates back to an issue you commented on late last 
>> year.   
>> https://groups.google.com/forum/?pli=1#!searchin/web2py/redis%7Csort:date/web2py/PdquGF_9a2E/6VJpLqsnBgAJ
>>
>> At that time I just continued using python redis 2.10.6.  But, can't do 
>> that forever.  Anyone able to test or improve upon the change I made 
>> above?  Like I said, it works for me, but I don't know how to see if I'm 
>> causing any other unforeseen damage.
>>
>> -Jim
>>
>> On Friday, March 29, 2019 at 7:49:03 PM UTC-5, Joe Barnhart wrote:
>>>
>>> Hi Leonel --
>>>
>>> My brain refuses to put together the words "session locked field".  I 
>>> understand the part of pickle smashing the values and encoding them as one 
>>> string.  The bool has something to do with session locking?  
>>>
>>> I've only looked at the web2py redis code in the most scant way as I 
>>> wasn't planning to become a redis expert.  Sessions in redis could be 
>>> important to me, tho, so I may need to set aside some time to dig into it. 
>>>  (Storing sessions in cookies has been problematic due to the limited space 
>>> for cookies in browsers.)
>>>
>>> -- Joe
>>>
>>>
>>> On Wednesday, March 27, 2019 at 4:49:25 PM UTC-7, Leonel Câmara wrote:

 It's not your values Joe, pickle serializes them as a string so they 
 would be fine. It's web2py session locked field which is True or False. 
 It's probably easy to fix this in redis_session.py

>>>

-- 
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] Compressed bootstrap.min.css

2019-04-02 Thread Константин Комков
Why web2py compressed bootstrap.min.css in old project and don't do that in 
new project. Web2py version is 2.18.4

-- 
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] pbkdf2_hmac error on PythonAnywhere

2019-04-02 Thread Nico Zanferrari
Hi,

I've also upgraded on PythonAnywhere from the web2py admin interface to
2.18.4, but without any problems. Does the error happen also with the
standard welcome app?

Nico

Il giorno mar 2 apr 2019 alle ore 10:30 Philip Kilner 
ha scritto:

> Hi,
>
> I've just upgraded web2py to 2.18.4 and auth is throwing: -
>
>  'module' object has no attribute
> 'pbkdf2_hmac'
>
> ...which I understand is because PythonAnywhere are using Python 2.7.6,
> but "pbkdf2_hmac" was introduced in 2.7.8.
>
> Is this a known issue?
>
> I'm not expecting to be able to ask PythonAnywheere to upgrade, so is
> there a robust workaround for this? (specifically on PythonAnywhere,
> where I have limited control over the Python environment)
>
>
>
> --
>
> Regards,
>
> PhilK
>
>
> 'a bell is a cup...until it is struck'
>
> --
> 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 again....

2019-04-02 Thread 黄祥
yes, you are right, my bad, like the idea of jekpack (combine server side 
(jekyll ruby) with client side (webpack js), perhaps can learn from it and 
adapt it to web3py.
ref:
https://github.com/yfxie/jekpack
ever thought of graphql as an option to REST?

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: Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
Overcame the issue for now using apache and mod_wsgi with self-signed
cert..

But something is definietly wrong with the rocket server at the moment..

On Tue, Apr 2, 2019 at 10:50 AM Kevin Keller  wrote:

> Same on a totally different fresh ubuntu server with python 3.6.. with
> version from github..
>
> On Tuesday, 2 April 2019 10:44:24 UTC+2, Kevin Keller wrote:
>>
>> On no.. it doesnt...
>>
>> On Tuesday, 2 April 2019 10:42:52 UTC+2, Kevin Keller wrote:
>>>
>>> Reverting to the version from the zip file on home page ("For Users")
>>> works..
>>>
>>> On Tuesday, 2 April 2019 10:32:16 UTC+2, Kevin Keller wrote:

 Works fine on windows10, python 3.7.1 without ssl and firing it up
 locally..

 On Tuesday, 2 April 2019 10:27:46 UTC+2, Kevin Keller wrote:
>
> Centos7
> Python 3.7.1
>
> git cloning this repo just now, generating ssl certs and then starting
> up
>
> like this:
> python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000
>
> trhows this after punching id admin pass:
>
>
> Exception in thread Thread-2:
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.7/threading.py", line 917, in
> _bootstrap_inner
> self.run()
>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in
> run
> conn = Connection(*conn)
>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in
> __init__
> self.socket.settimeout(SOCKET_TIMEOUT)
> OSError: [Errno 9] Bad file descriptor
>
> This exception is thrown continously and the browser does not load the
> web2py welcome page..
>
 --
> 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] Return random row on left join in one to many

2019-04-02 Thread David Orme

Hi,

I have two tables: `tx` contains a set of named objects and then `tx_vals` 
contain 0 to many possible values for those objects. I want to obtain a 
table that contains all named objects in `tx` and one random value from 
`tx_vals`. I think that has to be a left join to get the null values when a 
tx object does not appear in tx_vals. I can obviously do this by finding 
all the tx rows and then running a loop of queries on tx_vals, but I 
wondered if there was a way to get the DAL to do it in one pass.

The table structure is:

db.define_table('tx', Field('name', 'string'))
db.tx.bulk_insert([{'name':'a'}, 
   {'name':'b'},
   {'name':'c'}])

db.define_table('tx_vals', 
Field('tx_id', 'reference tx'), 
Field('val', 'integer'))

db.tx_vals.bulk_insert([{'tx_id': 1, 'val':1}, 
{'tx_id': 1, 'val':2}, 
{'tx_id': 2, 'val':3}, 
{'tx_id': 2, 'val':4})

What I'm after is something that returns:

[('a', 1), ('b', 3), ('c', None)]


and where `a` will get 1 or 2 and `b` will get 3 or 4 randomly.

Thanks,
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: How can I convert a SUM from a SQLite SELECT statement to web2py's DAL?

2019-04-02 Thread Dave S


On Tuesday, April 2, 2019 at 12:45:04 AM UTC-7, João Matos wrote:
>
> I had already read it. Unfortunately it didn't help.
>
>
Can you show what you tried with .sum() ?   Did you get errors, or did you 
get a result that was unexpected?  What was the expected result?

/dps


> terça-feira, 2 de Abril de 2019 às 00:23:14 UTC+1, Scott Hunter escreveu:
>>
>> This part of the web2py book might help: 
>> http://www.web2py.com/book/default/chapter/06#sum-avg-min-max-and-len
>>
>> On Monday, April 1, 2019 at 6:41:51 PM UTC-4, João Matos wrote:
>>>
>>> Hello,
>>>
>>> I have this SELECT in SQLite
>>>
>>> result = db.executesql(
>>> "SELECT auth_user.id, auth_user.username, "
>>> "auth_user.canceled_on, "
>>> "auth_user.canceled_by, "
>>> "SUM(auth_group.role = 'Operador') operador, "
>>> "SUM(auth_group.role = 'Verificador') verificador, "
>>> "SUM(auth_group.role = 'Supervisor') supervisor "
>>> "FROM auth_user "
>>> "LEFT JOIN auth_membership ON auth_user.id = 
>>> auth_membership.user_id "
>>> "LEFT JOIN auth_group ON auth_group.id = 
>>> auth_membership.group_id "
>>> "GROUP BY username ORDER BY username"
>>> )
>>>
>>> and would like to convert it to web2py's DAL.
>>> I made this
>>>
>>> query = db().select(
>>> db.auth_user.id,
>>> db.auth_user.username,
>>> db.auth_user.canceled_on,
>>> db.auth_user.canceled_by,
>>> left=(
>>> db.auth_membership.on(db.auth_user.id == db.auth_membership.
>>> user_id),
>>> db.auth_group.on(db.auth_group.id == db.auth_membership.group_id
>>> ),
>>> ),
>>> groupby=db.auth_user.username,
>>> orderby=db.auth_user.username,
>>> )
>>>
>>> but I can't find any way to integrate the sums.
>>>
>>> Does anyone know how to do it?
>>>
>>> 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 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: Is it possible to show the results from a SELECT (made with SQLite using db.executesql) in a grid?

2019-04-02 Thread João Matos
That worked. Thanks.

terça-feira, 2 de Abril de 2019 às 06:43:41 UTC+1, Val K escreveu:
>
> Create view in sqlite "CREATE VIEW your_tbl_name AS SELECT ..." using 
> executesql and define corresponding  web2py table with migrate=False, 
> fake_migrate=True

-- 
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: Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
Same on a totally different fresh ubuntu server with python 3.6.. with 
version from github.. 

On Tuesday, 2 April 2019 10:44:24 UTC+2, Kevin Keller wrote:
>
> On no.. it doesnt... 
>
> On Tuesday, 2 April 2019 10:42:52 UTC+2, Kevin Keller wrote:
>>
>> Reverting to the version from the zip file on home page ("For Users") 
>> works.. 
>>
>> On Tuesday, 2 April 2019 10:32:16 UTC+2, Kevin Keller wrote:
>>>
>>> Works fine on windows10, python 3.7.1 without ssl and firing it up 
>>> locally.. 
>>>
>>> On Tuesday, 2 April 2019 10:27:46 UTC+2, Kevin Keller wrote:

 Centos7
 Python 3.7.1

 git cloning this repo just now, generating ssl certs and then starting 
 up 

 like this: 
 python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000

 trhows this after punching id admin pass: 


 Exception in thread Thread-2:
 Traceback (most recent call last):
   File "/usr/local/lib/python3.7/threading.py", line 917, in 
 _bootstrap_inner
 self.run()
   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in run
 conn = Connection(*conn)
   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in 
 __init__
 self.socket.settimeout(SOCKET_TIMEOUT)
 OSError: [Errno 9] Bad file descriptor

 This exception is thrown continously and the browser does not load the 
 web2py welcome page..  

>>>

-- 
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: Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
On no.. it doesnt... 

On Tuesday, 2 April 2019 10:42:52 UTC+2, Kevin Keller wrote:
>
> Reverting to the version from the zip file on home page ("For Users") 
> works.. 
>
> On Tuesday, 2 April 2019 10:32:16 UTC+2, Kevin Keller wrote:
>>
>> Works fine on windows10, python 3.7.1 without ssl and firing it up 
>> locally.. 
>>
>> On Tuesday, 2 April 2019 10:27:46 UTC+2, Kevin Keller wrote:
>>>
>>> Centos7
>>> Python 3.7.1
>>>
>>> git cloning this repo just now, generating ssl certs and then starting 
>>> up 
>>>
>>> like this: 
>>> python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000
>>>
>>> trhows this after punching id admin pass: 
>>>
>>>
>>> Exception in thread Thread-2:
>>> Traceback (most recent call last):
>>>   File "/usr/local/lib/python3.7/threading.py", line 917, in 
>>> _bootstrap_inner
>>> self.run()
>>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in run
>>> conn = Connection(*conn)
>>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in 
>>> __init__
>>> self.socket.settimeout(SOCKET_TIMEOUT)
>>> OSError: [Errno 9] Bad file descriptor
>>>
>>> This exception is thrown continously and the browser does not load the 
>>> web2py welcome page..  
>>>
>>

-- 
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: Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
Reverting to the version from the zip file on home page ("For Users") 
works.. 

On Tuesday, 2 April 2019 10:32:16 UTC+2, Kevin Keller wrote:
>
> Works fine on windows10, python 3.7.1 without ssl and firing it up 
> locally.. 
>
> On Tuesday, 2 April 2019 10:27:46 UTC+2, Kevin Keller wrote:
>>
>> Centos7
>> Python 3.7.1
>>
>> git cloning this repo just now, generating ssl certs and then starting up 
>>
>> like this: 
>> python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000
>>
>> trhows this after punching id admin pass: 
>>
>>
>> Exception in thread Thread-2:
>> Traceback (most recent call last):
>>   File "/usr/local/lib/python3.7/threading.py", line 917, in 
>> _bootstrap_inner
>> self.run()
>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in 
>> __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> This exception is thrown continously and the browser does not load the 
>> web2py welcome page..  
>>
>

-- 
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: Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
Works fine on windows10, python 3.7.1 without ssl and firing it up 
locally.. 

On Tuesday, 2 April 2019 10:27:46 UTC+2, Kevin Keller wrote:
>
> Centos7
> Python 3.7.1
>
> git cloning this repo just now, generating ssl certs and then starting up 
>
> like this: 
> python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000
>
> trhows this after punching id admin pass: 
>
>
> Exception in thread Thread-2:
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.7/threading.py", line 917, in 
> _bootstrap_inner
> self.run()
>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in run
> conn = Connection(*conn)
>   File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in 
> __init__
> self.socket.settimeout(SOCKET_TIMEOUT)
> OSError: [Errno 9] Bad file descriptor
>
> This exception is thrown continously and the browser does not load the 
> web2py welcome page..  
>

-- 
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] pbkdf2_hmac error on PythonAnywhere

2019-04-02 Thread Philip Kilner

Hi,

I've just upgraded web2py to 2.18.4 and auth is throwing: -

 'module' object has no attribute 
'pbkdf2_hmac'


...which I understand is because PythonAnywhere are using Python 2.7.6, 
but "pbkdf2_hmac" was introduced in 2.7.8.


Is this a known issue?

I'm not expecting to be able to ask PythonAnywheere to upgrade, so is 
there a robust workaround for this? (specifically on PythonAnywhere, 
where I have limited control over the Python environment)




--

Regards,

PhilK


'a bell is a cup...until it is struck'

--
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] Newst Trunk Edition (4th April 2019) rocket wont start

2019-04-02 Thread Kevin Keller
Centos7
Python 3.7.1

git cloning this repo just now, generating ssl certs and then starting up 

like this: 
python3.7 web2py.py -k myapp.key -c myapp.crt -i 0.0.0.0 -p 8000

trhows this after punching id admin pass: 


Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 917, in 
_bootstrap_inner
self.run()
  File "/home/oracle/Projects/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/oracle/Projects/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

This exception is thrown continously and the browser does not load the 
web2py welcome page..  

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

2019-04-02 Thread Kevin Keller
Here is a project that generates swagger(openapi) documentation for
flask+sqlalchemy.  https://github.com/thomaxxl/safrs
I was already wondering about changing bottle with flask, but I dont know
if that is heresy now :).

On Tue, Apr 2, 2019 at 9:31 AM Kevin Keller  wrote:

>
> https://editor.swagger.io/?_ga=2.227432986.689200959.1554189909-55439989.1547630410
>
>
> Swagger JSON editor + https://swagger.io/specification/. So one Swagger
> Json file can contain the description of all the endpoints.
>
> On Tue, Apr 2, 2019 at 9:19 AM Kevin Keller  wrote:
>
>> I agree.
>>
>> In fact, the whole client side today should be Javascript and just
>> communicate via REST+JWT (even though in the enerprise space you will also
>> need OAUTH2).
>>
>>  The models need to be exposed via REST easiliy and it should be easy to
>> add auth to routes with JWT. Also the REST endpoints once defined, need to
>> generate openapi(swagger) documents automatically.
>>
>> This is much like the JSON route you wanted to go, but with openapi we
>> would be using an actual standard and do not tie ourselves to one
>> Javascript framework and once specific JSON format.
>>
>>  With that we could use something like this:
>> https://api-platform.com/docs/client-generator/ that generates Vue.js or
>> React.js CRUD pages basted on teh openapi documentation for the REST
>> endpoints.
>>
>> On Tue, Apr 2, 2019 at 8:58 AM Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> Th problem with SQLFORM is that different CSS libraries require
>>> different HTML stuctures. It is not as simple as selecting a class or div
>>> vs span. In web2py we have code to deal with bootstrap 2 and 3. We apply
>>> both classes. It is horrible. We should move away from generating html
>>> server side for forms. We should pass a json description and generate it
>>> client side
>>>
>>> On Sunday, 31 March 2019 00:54:23 UTC-7, 黄祥 wrote:

 Backporting SQLFORM, grid and Auth, should not be that complicated,
> although I think we can do better.
>

 sqlform, grid and auth is a great helper to make web2py as rapid
 application development, but please consider some of users who want to use
 another css or js framework.
 perhaps just follow the python principle 'Explicit is better than
 implicit', something like
 sqlform(), sqlform.grid() or form() signature have style='bootstrap',
 or class='something' or tag='div|span|table|tr|td'
 not sure just an idea
 perhaps can stick with the initial idea
 ref:
 https://groups.google.com/forum/#!msg/web2py/89a846kPeGA/nUpNJB_VCAAJ

 best regards,
 stifan

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

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


[web2py] Re: How can I convert a SUM from a SQLite SELECT statement to web2py's DAL?

2019-04-02 Thread João Matos
I had already read it. Unfortunately it didn't help.


terça-feira, 2 de Abril de 2019 às 00:23:14 UTC+1, Scott Hunter escreveu:
>
> This part of the web2py book might help: 
> http://www.web2py.com/book/default/chapter/06#sum-avg-min-max-and-len
>
> On Monday, April 1, 2019 at 6:41:51 PM UTC-4, João Matos wrote:
>>
>> Hello,
>>
>> I have this SELECT in SQLite
>>
>> result = db.executesql(
>> "SELECT auth_user.id, auth_user.username, "
>> "auth_user.canceled_on, "
>> "auth_user.canceled_by, "
>> "SUM(auth_group.role = 'Operador') operador, "
>> "SUM(auth_group.role = 'Verificador') verificador, "
>> "SUM(auth_group.role = 'Supervisor') supervisor "
>> "FROM auth_user "
>> "LEFT JOIN auth_membership ON auth_user.id = 
>> auth_membership.user_id "
>> "LEFT JOIN auth_group ON auth_group.id = 
>> auth_membership.group_id "
>> "GROUP BY username ORDER BY username"
>> )
>>
>> and would like to convert it to web2py's DAL.
>> I made this
>>
>> query = db().select(
>> db.auth_user.id,
>> db.auth_user.username,
>> db.auth_user.canceled_on,
>> db.auth_user.canceled_by,
>> left=(
>> db.auth_membership.on(db.auth_user.id == db.auth_membership.
>> user_id),
>> db.auth_group.on(db.auth_group.id == db.auth_membership.group_id
>> ),
>> ),
>> groupby=db.auth_user.username,
>> orderby=db.auth_user.username,
>> )
>>
>> but I can't find any way to integrate the sums.
>>
>> Does anyone know how to do it?
>>
>> 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 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 again....

2019-04-02 Thread Kevin Keller
https://editor.swagger.io/?_ga=2.227432986.689200959.1554189909-55439989.1547630410


Swagger JSON editor + https://swagger.io/specification/. So one Swagger
Json file can contain the description of all the endpoints.

On Tue, Apr 2, 2019 at 9:19 AM Kevin Keller  wrote:

> I agree.
>
> In fact, the whole client side today should be Javascript and just
> communicate via REST+JWT (even though in the enerprise space you will also
> need OAUTH2).
>
>  The models need to be exposed via REST easiliy and it should be easy to
> add auth to routes with JWT. Also the REST endpoints once defined, need to
> generate openapi(swagger) documents automatically.
>
> This is much like the JSON route you wanted to go, but with openapi we
> would be using an actual standard and do not tie ourselves to one
> Javascript framework and once specific JSON format.
>
>  With that we could use something like this:
> https://api-platform.com/docs/client-generator/ that generates Vue.js or
> React.js CRUD pages basted on teh openapi documentation for the REST
> endpoints.
>
> On Tue, Apr 2, 2019 at 8:58 AM Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> Th problem with SQLFORM is that different CSS libraries require different
>> HTML stuctures. It is not as simple as selecting a class or div vs span. In
>> web2py we have code to deal with bootstrap 2 and 3. We apply both classes.
>> It is horrible. We should move away from generating html server side for
>> forms. We should pass a json description and generate it client side
>>
>> On Sunday, 31 March 2019 00:54:23 UTC-7, 黄祥 wrote:
>>>
>>> Backporting SQLFORM, grid and Auth, should not be that complicated,
 although I think we can do better.

>>>
>>> sqlform, grid and auth is a great helper to make web2py as rapid
>>> application development, but please consider some of users who want to use
>>> another css or js framework.
>>> perhaps just follow the python principle 'Explicit is better than
>>> implicit', something like
>>> sqlform(), sqlform.grid() or form() signature have style='bootstrap', or
>>> class='something' or tag='div|span|table|tr|td'
>>> not sure just an idea
>>> perhaps can stick with the initial idea
>>> ref:
>>> https://groups.google.com/forum/#!msg/web2py/89a846kPeGA/nUpNJB_VCAAJ
>>>
>>> best regards,
>>> stifan
>>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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


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

2019-04-02 Thread Kevin Keller
I agree.

In fact, the whole client side today should be Javascript and just
communicate via REST+JWT (even though in the enerprise space you will also
need OAUTH2).

 The models need to be exposed via REST easiliy and it should be easy to
add auth to routes with JWT. Also the REST endpoints once defined, need to
generate openapi(swagger) documents automatically.

This is much like the JSON route you wanted to go, but with openapi we
would be using an actual standard and do not tie ourselves to one
Javascript framework and once specific JSON format.

 With that we could use something like this:
https://api-platform.com/docs/client-generator/ that generates Vue.js or
React.js CRUD pages basted on teh openapi documentation for the REST
endpoints.

On Tue, Apr 2, 2019 at 8:58 AM Massimo Di Pierro 
wrote:

> Th problem with SQLFORM is that different CSS libraries require different
> HTML stuctures. It is not as simple as selecting a class or div vs span. In
> web2py we have code to deal with bootstrap 2 and 3. We apply both classes.
> It is horrible. We should move away from generating html server side for
> forms. We should pass a json description and generate it client side
>
> On Sunday, 31 March 2019 00:54:23 UTC-7, 黄祥 wrote:
>>
>> Backporting SQLFORM, grid and Auth, should not be that complicated,
>>> although I think we can do better.
>>>
>>
>> sqlform, grid and auth is a great helper to make web2py as rapid
>> application development, but please consider some of users who want to use
>> another css or js framework.
>> perhaps just follow the python principle 'Explicit is better than
>> implicit', something like
>> sqlform(), sqlform.grid() or form() signature have style='bootstrap', or
>> class='something' or tag='div|span|table|tr|td'
>> not sure just an idea
>> perhaps can stick with the initial idea
>> ref:
>> https://groups.google.com/forum/#!msg/web2py/89a846kPeGA/nUpNJB_VCAAJ
>>
>> best regards,
>> stifan
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: web3py again....

2019-04-02 Thread Massimo Di Pierro
Th problem with SQLFORM is that different CSS libraries require different 
HTML stuctures. It is not as simple as selecting a class or div vs span. In 
web2py we have code to deal with bootstrap 2 and 3. We apply both classes. 
It is horrible. We should move away from generating html server side for 
forms. We should pass a json description and generate it client side

On Sunday, 31 March 2019 00:54:23 UTC-7, 黄祥 wrote:
>
> Backporting SQLFORM, grid and Auth, should not be that complicated, 
>> although I think we can do better.
>>
>
> sqlform, grid and auth is a great helper to make web2py as rapid 
> application development, but please consider some of users who want to use 
> another css or js framework.
> perhaps just follow the python principle 'Explicit is better than 
> implicit', something like
> sqlform(), sqlform.grid() or form() signature have style='bootstrap', or 
> class='something' or tag='div|span|table|tr|td'
> not sure just an idea
> perhaps can stick with the initial idea
> ref:
> https://groups.google.com/forum/#!msg/web2py/89a846kPeGA/nUpNJB_VCAAJ
>
> 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: Why python anywhere stuck with web2py 2.15 version

2019-04-02 Thread Nico Zanferrari
I think it's also time to switch to Python 3, at least as an option ;-)

Nico

Il giorno mar 2 apr 2019 alle ore 08:35 Massimo Di Pierro <
massimo.dipie...@gmail.com> ha scritto:

> I will talk to them. Maybe we can agree on a newer version. They do not
> have to change every single version but maybe every 3 months we can label a
> special version for deployment.
>
> On Monday, 1 April 2019 18:01:09 UTC-7, Ron Chatterjee wrote:
>>
>> I did. They said its lot of work to change from 2.14 to any newer version
>> and they don't have time.
>>
>>
>>
>> On Monday, April 1, 2019 at 7:27:23 PM UTC-4, Scott Hunter wrote:
>>>
>>> Shouldn't you ask them?
>>>
>>> On Monday, April 1, 2019 at 8:57:21 AM UTC-4, Ron Chatterjee wrote:

 Does anyone know why python anywhere only give option for 2.15 edition
 of web2py? If I have to guess that's few years old. I asked the question
 because I am not sure if they believe 2.15 is more stable for 2.18. Is any
 reason they use an older version of web2py?

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

-- 
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: Clear a form after submit

2019-04-02 Thread Marvi Benedet
Would be nice to have autofocus to the first filed of all SQLFORM by
default too...


(Off topic annoyance:   appadmin's "DB new record"  form doesn't use
> autofocus, and I feel it *should* take you to the first field.)
>
> /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: Why python anywhere stuck with web2py 2.15 version

2019-04-02 Thread Massimo Di Pierro
I will talk to them. Maybe we can agree on a newer version. They do not 
have to change every single version but maybe every 3 months we can label a 
special version for deployment.

On Monday, 1 April 2019 18:01:09 UTC-7, Ron Chatterjee wrote:
>
> I did. They said its lot of work to change from 2.14 to any newer version 
> and they don't have time.
>
>
>
> On Monday, April 1, 2019 at 7:27:23 PM UTC-4, Scott Hunter wrote:
>>
>> Shouldn't you ask them?
>>
>> On Monday, April 1, 2019 at 8:57:21 AM UTC-4, Ron Chatterjee wrote:
>>>
>>> Does anyone know why python anywhere only give option for 2.15 edition 
>>> of web2py? If I have to guess that's few years old. I asked the question 
>>> because I am not sure if they believe 2.15 is more stable for 2.18. Is any 
>>> reason they use an older version of web2py?
>>>
>>

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


[web2py] Re: Redis and Python3?

2019-04-02 Thread Massimo Di Pierro
we could change True/False with 1/0 but a better approach would be to 
remove the value within the redis adapter. The value of locked does not do 
anything anyway on redis since it is not a relational database with 
transactions.

On Sunday, 31 March 2019 10:19:20 UTC-7, Jim S wrote:
>
> I changed the following in gluon/globals.py and mine is working now.  But, 
> I'm unclear on how to test to see if it is handling the locking properly:
>
> dd = dict(locked=False,
>   client_ip=response.session_client,
>   modified_datetime=request.now,
>   session_data=session_pickled,
>   unique_key=unique_key)
>
> to 
>
> dd = dict(locked='False',
>   client_ip=response.session_client,
>   modified_datetime=str(request.now),
>   session_data=session_pickled,
>   unique_key=unique_key)
>
> This makes all my stuff work (I'm still on Python 2.7 but I think the 
> problem has to do with the python redis client moving to version 3).
>
> Leonel - I think this relates back to an issue you commented on late last 
> year.   
> https://groups.google.com/forum/?pli=1#!searchin/web2py/redis%7Csort:date/web2py/PdquGF_9a2E/6VJpLqsnBgAJ
>
> At that time I just continued using python redis 2.10.6.  But, can't do 
> that forever.  Anyone able to test or improve upon the change I made 
> above?  Like I said, it works for me, but I don't know how to see if I'm 
> causing any other unforeseen damage.
>
> -Jim
>
> On Friday, March 29, 2019 at 7:49:03 PM UTC-5, Joe Barnhart wrote:
>>
>> Hi Leonel --
>>
>> My brain refuses to put together the words "session locked field".  I 
>> understand the part of pickle smashing the values and encoding them as one 
>> string.  The bool has something to do with session locking?  
>>
>> I've only looked at the web2py redis code in the most scant way as I 
>> wasn't planning to become a redis expert.  Sessions in redis could be 
>> important to me, tho, so I may need to set aside some time to dig into it. 
>>  (Storing sessions in cookies has been problematic due to the limited space 
>> for cookies in browsers.)
>>
>> -- Joe
>>
>>
>> On Wednesday, March 27, 2019 at 4:49:25 PM UTC-7, Leonel Câmara wrote:
>>>
>>> It's not your values Joe, pickle serializes them as a string so they 
>>> would be fine. It's web2py session locked field which is True or False. 
>>> It's probably easy to fix this in redis_session.py
>>>
>>

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