Re: [web2py] Re: List | Create | Modify and Delete Users directly from Python controller without using HMI

2020-06-07 Thread AGRogers
Yes, thank you too. I will need that.

On Fri, 5 Jun 2020 at 06:50, Nicolas Hiblot  wrote:

> Thanks Dave and Val
> It's perfect !!
> Web2py forever
>
> Le mardi 2 juin 2020 23:57:31 UTC+2, Nicolas Hiblot a écrit :
>>
>> Hello All,
>>
>> I have read a lot of cases and uses cases about web2py users.
>> But my case is a little différent ;
>> I would like to
>>
>> *List | Create  | Modify and Delete Users directly from Python controller
>> without using HMI*
>>
>> My user db is always the same
>> login 1 is user0
>> login 2 is user1
>> and I can have a lot of users but user0 and user1 are always here
>>
>> 1) List all users by id and username *without* user0 and user1
>>
>>
>>
>>
>>
>> *try :listusers = db(db.auth.if
>> len(listusers) == 0:except Exception as e:listusers = []*
>>
>> 2) Create a user *with a mail / login / and Password* directly using
>> python method in the controller with the db (without the GUI)
>>
>>
>> 3) *Modify a password of an already created user* directly using python
>> method in the controller with the db (without the gui)
>> Note : I have already the id and/or the username of the user
>>
>> 4) *Delete an already created user* directly using python method  in the
>> controller with the db (without the gui)
>> Note : I have already the id and/or the username of the user
>>
>>
>> Thanks in advance
>> Regards
>>
>>
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/23b5c0d8-6366-41c8-ad58-85504a4efe8do%40googlegroups.com
> 
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CACWMBMP4dqfGatrpKHPi0JycUV8JOiR_7wstQfydzXA-qkiDmg%40mail.gmail.com.


Re: [web2py] Re: web2py online debugger under python3

2020-06-07 Thread AGRogers
Great. I have had weird problems with Visual Studio Code debugger. It seems
to get confused sometimes about which line of code it is running and shows
that I am executing a line different to what it is really executing. When i
have that problem i switch to PyCharm and debug there. Then i head back to
Visual Studio Code :)


On Fri, 5 Jun 2020 at 05:48, Clemens 
wrote:

> Hi Andrew,
>
> I've switched over to PyCharm and really like it. Thanks a lot for the
> push!
>
> Best regards
> Clemens
>
>
> On Wednesday, May 6, 2020 at 3:11:00 AM UTC+2, AGRogers wrote:
>>
>> Hi Clemens
>>
>> I think a standalone debugger is much better. The online debugger could
>> be great to debug applications in production  though.
>>
>> Where are you doing your development? On your local machine or Python
>> Anywhere or somewhere else?  I don't think it's possible to debug using
>> Visual Studio Code or PyCharm if web2py is not running on your local
>> machine. The debugger needs to connect to the python process.
>>
>> Anyhow, it's not hard to do once you know where to look. I managed to get
>> PyCharm debugging in about 15 minutes - most of that was spent downloading
>> the app for the first time.
>>
>> Cheers
>> Andrew
>>
>> On Wed, 6 May 2020 at 07:04, Clemens  wrote:
>>
>>> Hi Andrew,
>>>
>>> well, I would say, it's because I ever used it and it's okay for me. But
>>> which one would you recommend? And how to connect your favorite debugger
>>> with web2py? Never used another debugger for web2py.
>>>
>>> Regards
>>> Clemens
>>>
>>>
>>> On Tuesday, May 5, 2020 at 1:56:25 AM UTC+2, AGRogers wrote:

 Hi Clemens

 I definitely can't help you with this problem. Sorry. But I am
 interested in why you use the online debugger and not something else?

 Thanks
 Andrew

 On Mon, 4 May 2020 at 23:50, Clemens 
 wrote:

> Hello Massimo,
>
> I hoped the latest web2py version would fix the problem. My current
> configuration is now:
> web2py version 2.20.4-stable+timestamp.2020.05.03.05.18.50, Running on
> Rocket 1.2.6, Python 3.6.9, Ubuntu 18.04., Firefox 75.0 (64-bit)
>
> But the online debugger still doesn't work. The debugger doesn't catch
> the breakpoint, set in my code. Instead, after waiting a few minutes I got
> the following new situation:
>
> [image: Screenshot_2020-05-04 interact.png]
>
> [image: Screenshot_2020-05-04 interact-02.png]
> Do you have any idea, how I can fix this?
>
> Best regards
> Clemens
>
>
> On Sunday, April 26, 2020 at 8:46:00 AM UTC+2, Massimo Di Pierro wrote:
>>
>> what browser?
>>
>> On Monday, 30 March 2020 13:23:57 UTC-7, Clemens wrote:
>>>
>>> Hello everybody!
>>>
>>> I've switched my web2py app from python2 to python3. The app itself
>>> works fine, but the web2py online debugger doesn't work anymore and is
>>> mostly freezing. Sometimes a get the following error message:
>>>
>>> Exception timeout: timeout('timed out',)
>>>
>>> Traceback (most recent call last): File
>>> "/usr/lib/python3.6/socket.py", line 586, in readinto return
>>> self._sock.recv_into(b) socket.timeout: timed out
>>>
>>> My configuration is as follows:
>>>
>>> web2py 2.19.1-stable+timestamp.2020.03.21.21.49.28 (Running on
>>> Rocket 1.2.6, Python 3.6.9), Ubuntu 18.04 LTS
>>>
>>> What do I have to change additionally that the online debugger is
>>> working under python3?
>>>
>>>
>>> Thanks a lot for any support!
>>>
>>>
>>> Best regards Clemens
>>>
>> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/ccc32a55-4a15-4f88-9b0f-69326542b6f0%40googlegroups.com
> 
> .
>
 --
>>> 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.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/73792fd3-310e-43e6-89d6-5f615e12546d%40googlegroups.com
>>> 

Re: [web2py] Tip - Using multiple web2py templates

2020-06-07 Thread AGRogers
Thanks for sharing this. I might need it soon.

On Tue, 2 Jun 2020 at 07:44, Rodrigo Attique 
wrote:

> After a lot of brainstorming I found a way to allow web2py to use multiple
> templates. Perhaps for the elderly it is not a novelty, but for the
> youngest ... This will be a hand in the wheel.
>
> Link:
>
> https://web2pymania.blogspot.com/2020/06/using-multiple-web2py-templates.html
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/6bc7a9fe-43f6-4c9b-8950-8952a0611b8c%40googlegroups.com
> 
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CACWMBMOvbPZRX6ZkXAiK10LLMBOU6Q4%3DRcampCn%3Dyp%3Dgqx3JVQ%40mail.gmail.com.


[web2py] how do I read localstorage data stored in database

2020-06-07 Thread Maurice Waka
with this code:

js(view)

$('#timed').change(function(){  
arr.push($(this).val());
var arrayJSON = JSON.stringify(arr);
localStorage.setItem("tabledata",arrayJSON);

controller
value =request.vars.json
if valued:
db.post.insert(message=value)



My data is stored as 





how can I read a clean list like:

["sure","<39","unconfirmed_pcr"] or ["sure,<39,unconfirmed_pcr"]

Currently i'm using n.replace(). Is there a better, faster way?

Kind regards

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2b03ea7d-808d-4409-98bf-b24e5e1a1b5eo%40googlegroups.com.


Re: [web2py] How to clear a list in a view with jquery

2020-06-07 Thread António Ramos
i guess you mean
{{for detail in details:}}
instead of
{{for detail*s* in details:}}

anyway
the python code is rendered in server before being sent to the view. so
your script cant change any of your python code output
You could use the ajax function to update a div content or better vuejs or
other frontend framework...

Ramos

Em sáb., 6 de jun. de 2020 às 23:13, mostwanted 
escreveu:

> Guys is it possible to clear a list in a view using jquery?
> Something like this:
>
> *CODE EXAMPLE:*
> {{if details:}}
> {{for details in details:}}
>
> {{=details.first_name}}
> {{=details.last_name}}
> {{pass}}
>
>
>
>
>
>
>
>
>
>
> *$(function(){$('#close').click(function(e){{{details.clear()}};});});*
>
> How can I achieve this because?
>
> Regards;
>
> Mostwanted
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/9831eef9-75ec-4c58-b86b-92f97d59e510o%40googlegroups.com
> 
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEM0BxNm1_4ovkC5aD2XCbSztLDExOC-EyvSLpoAN43gDgA8fA%40mail.gmail.com.