Re: [web2py] Re: Redis and Python3?

2019-03-31 Thread Jim Steil
Thanks Joe

Not what I wanted to hear, but the right answer. I'm just going to have to
keep redis back leveled for now.

Jim


On Sun, Mar 31, 2019, 10:40 PM Joe Barnhart  wrote:

> Looking at the rest of globals.py I don't think this approach will work.
> For one, it affects storing sessions in any database, not just redis.
> Since the table is declared with a "boolean" field I don't think its gonna
> like the string version of "False".
>
> I wonder why we don't have a simple minded dialect in DAL for redis.
> Admittedly, it's not a RDBMS so a lot of DAL just won't ever work on
> redis.  But it would have provided a clean place to map "booleans" to
> strings instead of bools in this case, making it easy to special-case redis.
>
> But maybe that would encourage people to complain that the implementation
> of the redis DAL dialect is too deficient.  Putting it in DAL would raise
> people's expectations of what it can handle.
>
> -- Joe
>
>
> On Sunday, March 31, 2019 at 10:19:20 AM 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/0iU2wqSik0k/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: Redis and Python3?

2019-03-31 Thread Joe Barnhart
Looking at the rest of globals.py I don't think this approach will work. 
 For one, it affects storing sessions in any database, not just redis. 
 Since the table is declared with a "boolean" field I don't think its gonna 
like the string version of "False".

I wonder why we don't have a simple minded dialect in DAL for redis. 
 Admittedly, it's not a RDBMS so a lot of DAL just won't ever work on 
redis.  But it would have provided a clean place to map "booleans" to 
strings instead of bools in this case, making it easy to special-case redis.

But maybe that would encourage people to complain that the implementation 
of the redis DAL dialect is too deficient.  Putting it in DAL would raise 
people's expectations of what it can handle.

-- Joe


On Sunday, March 31, 2019 at 10:19:20 AM 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] Re: Click the update web2py button in Python Anywhere (PA) leads to crash.

2019-03-31 Thread 黄祥
*pls read carefully first or test on another pc first, before execute on 
server bash*
# change to home directory
cd

# make folders for appdata
mkdir -p ~/appdata/applications
mkdir -p ~/appdata/databases
mkdir -p ~/appdata/uploads

# backup applications
mv ~/web2py/applications/* ~/appdata/applications/
rm -rf ~/appdata/applications/admin
rm -f ~/appdata/applications/*init*

# download
rm -f ~/web2py_src.zip
wget -c http://web2py.com/examples/static/web2py_src.zip
#curl -L -O -C - http://web2py.com/examples/static/web2py_src.zip

# remove existing folders
rm -rf ~/web2py/applications
rm -rf ~/web2py/deposit
rm -rf ~/web2py/examples
rm -rf ~/web2py/extras
rm -rf ~/web2py/gluon
rm -rf ~/web2py/handlers
rm -rf ~/web2py/logs
rm -rf ~/web2py/scripts
rm -rf ~/web2py/site-packages

# extract
unzip ~/web2py_src.zip

# remove unnecessary folders
rm -rf ~/web2py/applications/examples
rm -rf ~/web2py/applications/welcome

# remove downloaded package
rm -f ~/web2py_src.zip

# restore Applications
mv ~/appdata/applications/* ~/web2py/applications/

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: Click the update web2py button in Python Anywhere (PA) leads to crash.

2019-03-31 Thread Nico Zanferrari
Hi Ron,

the integrated upgrade button works fine on PA. But after obtaining the
ticket error on the web2py page you have to go to the PA admin page, under
the WEB tab, and press the green RELOAD button. The page is something like "
https://www.pythonanywhere.com/user/yourname/webapps/#tab_id_yourname_pythonanywhere_com

"

Cheers,
Nico

Il giorno dom 31 mar 2019 alle ore 16:20 Ron Chatterjee <
achatterjee...@gmail.com> ha scritto:

>
> That's the button in PA lead to crash. Usually in my local computer I will
> just delete the old web2py and install a refresh. I don't know how to do
> this using bash while keeping my old application folder. Any help on this
> will be appreciated.
>
>
>
>
> On Sunday, March 31, 2019 at 9:18:32 AM UTC-4, Ron Chatterjee wrote:
>>
>> Hello, Clicked on the update button on python anywhere and web2py didn't
>> update. Python Anywhere send me a link to help the issue which doesn't help
>> the issue. May be they don't have a clue. Have anywhere created a python
>> anywhere site where they "update" the web2py using the PA button and it
>> crashed?
>>
>> Looking for some support as there are lack of support on this from PA.
>>
>> One way I can think of is go to the file area and upload a fresh copy of
>> web2py but its been a while I used unix. Not sure how it can be done from
>> the bash.
>>
> --
> 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: Redis and Python3?

2019-03-31 Thread Jim S
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] Re: web3py again....

2019-03-31 Thread Massimo Di Pierro
 The app that is supposed to respond to:
http://localhost:8000/_error/{uuid} 

does not exist yet. It is an easy todo. Maybe I will do it today.

This is not going to be backward compatible for another month. Do not 
expect to update web3py.py and existing apps to work. Expect they will not 
work.

-- 
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: placeholder for update record field names

2019-03-31 Thread Steve
Hi Anthony,

Thanks, i will give it a try

Op vrijdag 29 maart 2019 21:53:49 UTC+1 schreef Anthony:
>
> You can create a dictionary of field names and values and then do:
>
> workrecord.update_record(**dict_of_new_values)
>
> Anthony
>
> On Friday, March 29, 2019 at 4:49:28 PM UTC-4, Steve wrote:
>>
>> Hi All,
>>
>> When updating a record i would like to make some column names variable.
>> I have the next statement : workrecord.update_record(starttime=iid.start, 
>> t1=worktime, c1=amount)
>>
>> I would like to make the field t1 variable so that ik can replace the 1 
>> with another number.!
>> Any a suggestion if this is possible and if so how.
>>
>> The %s or %d does not work on fieldnames
>>
>> Steve
>>
>

-- 
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: placeholder for update record field names

2019-03-31 Thread Steve
Hi Anthony,

Thanks, i will give it a try

Op vrijdag 29 maart 2019 21:53:49 UTC+1 schreef Anthony:
>
> You can create a dictionary of field names and values and then do:
>
> workrecord.update_record(**dict_of_new_values)
>
> Anthony
>
> On Friday, March 29, 2019 at 4:49:28 PM UTC-4, Steve wrote:
>>
>> Hi All,
>>
>> When updating a record i would like to make some column names variable.
>> I have the next statement : workrecord.update_record(starttime=iid.start, 
>> t1=worktime, c1=amount)
>>
>> I would like to make the field t1 variable so that ik can replace the 1 
>> with another number.!
>> Any a suggestion if this is possible and if so how.
>>
>> The %s or %d does not work on fieldnames
>>
>> Steve
>>
>

-- 
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 to add users to existing programmatically using an if statement

2019-03-31 Thread Leonel Câmara
register_bare returns the user record, so you can get user_id in user.id

You can get the group id by doing

# Assuming you create a group with role = 'Manager' and another with role = 
'Assistante'
group_id_manager = auth.id_group('Manager')
group_id_assistant = auth.id_group('Assistant')

Alternatively you can also get the id of the logged in user in auth.user_id

-- 
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] Click the update web2py button in Python Anywhere (PA) leads to crash.

2019-03-31 Thread Ron Chatterjee
Hello, Clicked on the update button on python anywhere and web2py didn't 
update. Python Anywhere send me a link to help the issue which doesn't help 
the issue. May be they don't have a clue. Have anywhere created a python 
anywhere site where they "update" the web2py using the PA button and it 
crashed?

Looking for some support as there are lack of support on this from PA. 

One way I can think of is go to the file area and upload a fresh copy of 
web2py but its been a while I used unix. Not sure how it can be done from 
the bash. 

-- 
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-03-31 Thread 黄祥

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


[web2py] Re: web3py again....

2019-03-31 Thread 黄祥
new behaviour learned for now:
1. start server with python web3py.py applications/, then copy the app and 
access the new app in the browser will result : Error: 404 Not Found, 
solution whenever add new app must restart the server (gunicorn)
2. seems index not the default function like in web2py, no worries, just 
need to adapt with this new behaviour
3. the session seems store in browser like cookies, to get rid the session 
seems must clear the cookies in browser, tested with remove the todo app, 
and clone the git again, when access the todo app, the counter session will 
increase
4. no error traceback on browser yet, the link provided but when it's 
clicked return:
Error: 404 Not Found
Sorry, the requested URL 
'http://localhost:8000/_error/59d20351-4496-4b4f-a8de-04768925d4b1' caused 
an error:

Not found: '/_error/59d20351-4496-4b4f-a8de-04768925d4b1'

*check on terminal :*
ERROR:root:Traceback (most recent call last):
  File "/Users/sugizo/learn/python/web3py/web3py.py", line 227, in wrapper
output = function(*func_args, **func_kwargs)
  File "/Users/sugizo/learn/python/web3py/applications/todo0/__init__.py", 
line 15, in index
session['counter'] = session.get('counter', 0) + 1
  File "/Users/sugizo/learn/python/web3py/web3py.py", line 183, in get
return self.local.data.get(key, default)
AttributeError: '_thread._local' object has no attribute 'data'

the error no 4 occured when tried to have the previous todo app (app 
without bulma css) with the current update (to test backward compatibility)

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

2019-03-31 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 is contrary to web2py/web2py philosophy. If we can integrate 
web3py+behave+selenium using a SDL it would be a great way to generate 
tests for apps, not for web3py itself.

On Saturday, 30 March 2019 23:48:10 UTC-7, Christopher Smiga wrote:
>
> 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 (BDD), CI/CD, 
> performance testing, functional testing, and code integrity via SonarQube 
> being considered in the build process? 
>
> Web3Py has the potential of being the next world class web framework. What 
> is the plan for development of this new endeavor since automation test 
> development is important? 
>
> Thanks and regards, 
> Christopher Smiga 
> SDET (Software Development Engineer in Test)

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

2019-03-31 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 for applications to be in changed of including the 
framework. 
Anyway, unlike web2py, web3py does allow this as an option, if you want to 
run a single application. I just have not documented it.


On Saturday, 30 March 2019 22:22:16 UTC-7, Carlos Cesar Caballero wrote:
>
> 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 features list or guidelines, maybe I can give a hand.
>
> Greetings.
>
>
> El 28/3/19 a las 5:16 a.m., Massimo Di Pierro escribió:
>
> 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.
>
>

-- 
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-03-31 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://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:
>
> Not found: '/todoo'
>
>
> *result on terminal*
>
> 127.0.0.1 - - [31/Mar/2019 09:47:52] "GET /todoo HTTP/1.1" 404 730
>
> 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] how to add users to existing programmatically using an if statement

2019-03-31 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,password=password,
)
if user:
return auth.add_membership(group_id, user_id)

else: 
return  auth.add_membership(group_id, user_id)

return redirect(URL('admin'))


I would like to know how to get the group_id and user_id

Below is my view:
   

Email




Password



Confirm 
password



  Select 
Role
  Assitant
  Manager
 
  

Add admin


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

2019-03-31 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 (BDD), CI/CD, 
performance testing, functional testing, and code integrity via SonarQube being 
considered in the build process?

Web3Py has the potential of being the next world class web framework. What is 
the plan for development of this new endeavor since automation test development 
is important?

Thanks and regards,
Christopher Smiga
SDET (Software Development Engineer in Test)

-- 
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-03-31 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 request is faster if accessed often.

>
>- unlike web2py, web3py does not use custom import or eval
>
> is custom import is same like import from modules folders in web2py app ?
>

custom import makes sure that for every app web2py first looks in the 
app/modules folder. This causes some modules to break if they are designed 
to only work when pip installed. the new design should have these problem 
because does not mess with imports (at least not at the same level)
 

> is eval same like in python ?
>

we do not use eval but in web2py we execute modules instead of importing 
them. This is not the case in web3py.
 

> ref:
> http://web2py.com/books/default/chapter/29/02/the-python-language#exec-eval
>
>- dynamic module reloading is only partially supported
>
> then what about dynamic module reload in this term ?
>

In web2py we do not realod the modules. we reimport them at every request. 
this causes a performance penalty and is only needed in development.
web3py (current version) uses bottle.run(reload=True) which reloads the 
module if they change but crashes the whole thing if there is an import 
error. There is a better way and I am working on it.
 

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