[web2py] Re: How do you update a deployed app?

2019-11-28 Thread Ruslan Gareev
Hello. If you make 
migrate=False
in appconfig.ini it will not make any migrations.

пятница, 29 ноября 2019 г., 2:07:56 UTC+5 пользователь Guilherme Botelho 
написал:
>
> I have an app which is currently running on Pythonanywhere, and would like 
> to know if there is an easy way to update it without messing up the 
> database.
>
> I usually work on my project using SelfHost, then I package it and 
> overwrite the one running in the Pythonanywhere server with the new 
> version. I can afford to do this for now as it is still in testing, but I 
> would like to know if there is a simple way to release updates to an app 
> which has to keep it's database unchanged through the update.
>
> Thanks!
>

-- 
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/08baa678-89f6-4c2b-a20e-cb46145e2bd8%40googlegroups.com.


[web2py] Re: Filter table by headers

2019-11-28 Thread Ruslan Gareev
Hi! Maybe using Datables  will feet your request. 

пятница, 29 ноября 2019 г., 2:07:55 UTC+5 пользователь Josh B написал:
>
> Hi,
>
> Does anyone know how to add filters to table headers (so that the user can 
> filter a table using table data from each column)?
>
> I'm struggling doing it with  and I've seen some ideal solutions 
> in java but they don't seem to work for me (see below).
>
> Any help greatly appreciated - v new to programming!
> Thanks
> Josh
>
> my table views:
> 
> 
> Assigned to
> Type
> Priority
> Project
> Task description
> Attachments
> Due Date
> 
>
> {{for row in rows:}}
> 
> 
> {{=row.auth_user.FullName}}
> {{=row.tasklist.jobtype}}
> {{=row.tasklist.priority}}
> {{=row.tasklist.projectid}}
> {{=row.tasklist.heading}}
> {{=row.tasklist.attachment}}
> {{=row.tasklist.duedate}}
> 
> {{pass}}
> 
>
> java:
>
>1.   
>2. //3. var table1_Props =  {  
>4. col_0: "select",  
>5. on_change: false,  
>6. btn: true,  
>7. enter_key: false  
>8. }  
>9. var tf4 = setFilterGrid( "table1",table4_Props );  
>10. //]]>  
>11.   
>
>

-- 
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/ac803030-1ea1-4883-9126-d371c448b5bf%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-28 Thread Massimo Di Pierro
py4web does sessions in redis by default (if you have redis). Just saying.

On Thursday, 28 November 2019 14:56:37 UTC-8, Jose C wrote:
>
>
>> Any feel for how many people are using redis for sessions?
>>
>> +1 on on redis for sessions.  Use it for multiple apps although they're 
> all older web2py versions and python 2 setups.  Upgrading one to python 3 
> and web2py 2.18.5 which is when the redis session functionality broke.  
> Jim's fix is working for me on python3 with the early Nov master of web2py 
> (pre 2.19.0 it appears from changelog).  Sessions appear to be working as 
> intended under this setup.
>
> I think Leonel posted earlier that they're also using redis for sessions.
>
> HTH,
>

-- 
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/c60056e0-2af9-44f3-a382-1f117d2c8b09%40googlegroups.com.


[web2py] Re: How to access db in a new thread ?

2019-11-28 Thread Massimo Di Pierro
No you cannot and you should not. In web2py you have one thread per http 
request. You should not spawn other threads because you either slow down 
responses or you may leak memory.
This is not web2py specific. This is true for all web applications.

What is your ultimate goal? There is probably a proper way to do what you 
need.

On Thursday, 28 November 2019 13:07:56 UTC-8, Marc Legendre wrote:
>
> Hello,
>
> I would like to access to the db variable declared in db.py in another 
> thread but I get this error:
>
> AttributeError: 'thread._local' object has no attribute 
> '_pydal_connection_140400076448208_2359
>
> Despite a lot of research, I can't find a way to make it work. Does anyone 
> has an idea of how to counter this problem ?
>

-- 
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/ed1a7c2b--43f3-bf58-7f173df5675c%40googlegroups.com.


[web2py] Re: Extraction of web2py configuration support

2019-11-28 Thread Massimo Di Pierro
Not sure I know what you are talking about. What is the configuration 
support?

On Thursday, 28 November 2019 13:07:56 UTC-8, The Living Cosmos wrote:
>
> I believe long ago the web2py configuration support was released 
> separately. Could someone provide me with the link?
>
>

-- 
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/f20e2da1-134e-4777-8b3c-f1e33be1b75e%40googlegroups.com.


[web2py] Re: web2py on an existing PostgreSQL Database?

2019-11-28 Thread Massimo Di Pierro
Cannot talk about Django.

In web2py you can run the script: web2py/scripts/extract_pgsql_models.py 
which will generate a model from your database table. It is not guaranteed 
to work. It depends on the type of references that you have. Also after it 
crates the model for you, you may need to modify it since in order to 
generate forms, web2py may need more info that it can extract from the 
database. In any case, after the model is generated the appadmin should 
work.

You probably are better off using this https://www.pgadmin.org/

On Thursday, 28 November 2019 13:07:55 UTC-8, Ulrich Goebel wrote:
>
> Hi,
>
> I have an existing PostgreSQL Database with about 20 tables, using 
> collating sequences, foreign keys, triggers, and even additional indexes. 
> For that database I want to write a WEB-frontend to insert, update and 
> delete data in the database. I don't want to define the data model in 
> python or web2py, but want to make django/python work on the existing 
> database.
>
> Is that possible? Where to find som helpful hints how to do that?
>
> Best regards
> Ulrich
>

-- 
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/1771cbfc-14e3-4a45-8801-c2cfbf7b18cd%40googlegroups.com.


[web2py] Re: vscode with web2py

2019-11-28 Thread Massimo Di Pierro
I have not but I am pretty sure it will not recognize the objects in the 
global environment unless you use the usual trick:

if False:
import anything already defined that you want vscode to see

py4web will work with vscode without hacks.


On Thursday, 28 November 2019 13:07:55 UTC-8, william vegas wrote:
>
> Hello guys. Any of you have configured vscode to work with web2py? that it 
> recognizes all the methods and so on. Do you know any video or guide? Any 
> help would be appreciated! Thanks! 
>

-- 
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/9cdb8f4c-a668-441c-8423-80a9bc911efc%40googlegroups.com.


[web2py] Re: New databse overwriting old one on app update

2019-11-28 Thread Massimo Di Pierro
If the database structure did not change if you copy the new files over the 
deployed ones (except the content of the databases/ folder) you should be 
fine.

On Thursday, 28 November 2019 13:07:54 UTC-8, Guilherme Botelho wrote:
>
> I have a simple web2py app deployed, and would like to be able to update 
> it (by reistalling) without overwriting the existing database data with the 
> test one from my development version, I've read a few other posts from this 
> group, but none seemed to do the trick, any ideias on how to do it?
>
> I've also tried playing with the migrations and fake_migrations but it 
> also didn't do anything.
>

-- 
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/243f7830-38d3-4334-ad21-a6c1fb54dd83%40googlegroups.com.


[web2py] Re: Error on model db.py

2019-11-28 Thread Jose C
Remove the bracket after 'reference person' on line 16.



On Thursday, 28 November 2019 21:07:56 UTC, Chuck G. Madamombe wrote:
>
> I have attached the code and the error message. Please help!
>

-- 
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/cbce4898-abaf-4540-88b9-05d34f60bc86%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-28 Thread Jose C

>
>
> Any feel for how many people are using redis for sessions?
>
> +1 on on redis for sessions.  Use it for multiple apps although they're 
all older web2py versions and python 2 setups.  Upgrading one to python 3 
and web2py 2.18.5 which is when the redis session functionality broke.  
Jim's fix is working for me on python3 with the early Nov master of web2py 
(pre 2.19.0 it appears from changelog).  Sessions appear to be working as 
intended under this setup.

I think Leonel posted earlier that they're also using redis for sessions.

HTH,

-- 
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/a1793f04-baff-4550-be1a-46117b3f712e%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-28 Thread Jim S
I submitted one quite some time ago for Python 2 and python redis 2 and 3, 
but not for Python 3.  The fix I proposed here doesn't not work for Python 
2.While I'd prefer to put sessions in redis, they work perfectly well 
in the database.  Redis works just fine (any version) as long as you're not 
use the redis_session.py in the web2py redis integration.

Long story short, I do not have a PR that fixes for redis 2 and 3 and 
python 2 and 3.

Any feel for how many people are using redis for sessions?

-Jim

On Thursday, November 28, 2019 at 3:47:36 PM UTC-6, Massimo Di Pierro wrote:
>
> Did I drop the ball on this one? I do not see a PR
>
> On Thursday, 21 November 2019 08:22:58 UTC-8, Jim S wrote:
>>
>> FWIW - I gave up on waiting.  Converted my sessions to use the database.
>>
>> I use redis in other parts of my app within web2py and am having no 
>> troubles there.  
>>
>> -Jim
>>
>> On Friday, November 15, 2019 at 1:45:25 PM UTC-6, Jim S wrote:
>>>
>>>
>>> Do you know much about sessions?  Are the values all supposed to be 
>>> binary?  The .decode on the 
>>>
>>> if to_native(rtn['unique_key']) == to_native(self.unique_key):
>>>
>>> was to convert it from binary to test against the string stored in 
>>> self.unique_key.
>>>
>>> Also, this fix isn't working in my python 2 installation.  I'm getting 
>>> other errors there but haven't had time to dig through it enough.
>>>
>>> But, I really appreciate you taking a look.  To me, this is a huge 
>>> problem that needs to be resolved.  Or, we have to stop using redis for 
>>> sessions or the web2py redis layer completely.
>>>
>>> -Jim
>>>
>>>
>>> On Friday, November 15, 2019 at 12:45:44 PM UTC-6, Leonel Câmara wrote:

 I haven't tried it, but I think the best fix is not to make the decode 
 work by putting the obviously missing parenthesis. The fix is simply to 
 remove the .decode, because to_native should take care of it, so this:

 rtn = {to_native(k.decode): v for k, v in self.db.r_server.hgetall(key
 ).items()}

 Would become

 rtn = {to_native(k): v for k, v in self.db.r_server.hgetall(key).items
 ()}

 The second decode you used is also probably wrong although it may work 
 with python 3. I would say it should be like this

 if to_native(rtn['unique_key']) == to_native(self.unique_key):

 If no one makes a pull request in the mean time, I'll probably have 
 time to test this later in the month and do it.



-- 
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/95493aef-fb20-4cf6-8de3-df732f87df6b%40googlegroups.com.


[web2py] Re: Web2py with python 3.8.0

2019-11-28 Thread Massimo Di Pierro
At this time we do not support python 3.8. It seems to have broken both 
web2py and py4web in different ways. I think 3.8 should be fixed, not 
web2py,

On Friday, 22 November 2019 07:07:18 UTC-8, Woody wrote:
>
> I updated to Python 3.8 on Arch Linux today and I had the same problem 
> with 'escape'. I patched the languages.py file and got web2py to start, but 
> then hit another error:
>
> Traceback (most recent call last):
>   File "/home/www/web2py/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "/home/www/web2py/applications/x10_security/models/db.py" 
> , line 
> 55, in 
> auth.define_tables(username=False, signature=False)
>   File "/home/www/web2py/gluon/tools.py", line 2092, in define_tables
> super(Auth, self).define_tables(username, signature, migrate, 
> fake_migrate)._table_signature_list
>   File "/home/www/web2py/gluon/authapi.py", line 322, in define_tables
> db.define_table(
>   File "/home/www/web2py/gluon/packages/dal/pydal/base.py", line 592, in 
> define_table
> table = self.lazy_define_table(tablename, *fields, **kwargs)
>   File "/home/www/web2py/gluon/packages/dal/pydal/base.py", line 623, in 
> lazy_define_table
> self._adapter.create_table(
>   File "/home/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
> 798, in create_table
> return self.migrator.create_table(*args, **kwargs)
>   File "/home/www/web2py/gluon/packages/dal/pydal/migrator.py", line 299, in 
> create_table
> sql_fields_old = pickle.load(tfile)
> TypeError: file must have 'read', 'readinto' and 'readline' attributes
>
>
> I looked for a discussion or patch for this, but I didn't find one. Can 
> anybody tell me how to fix this?
>

-- 
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/a114a3ba-6bba-48a8-aa56-92bf5fcd046a%40googlegroups.com.


[web2py] Re: Redis session error - latest web2py master

2019-11-28 Thread Massimo Di Pierro
Did I drop the ball on this one? I do not see a PR

On Thursday, 21 November 2019 08:22:58 UTC-8, Jim S wrote:
>
> FWIW - I gave up on waiting.  Converted my sessions to use the database.
>
> I use redis in other parts of my app within web2py and am having no 
> troubles there.  
>
> -Jim
>
> On Friday, November 15, 2019 at 1:45:25 PM UTC-6, Jim S wrote:
>>
>>
>> Do you know much about sessions?  Are the values all supposed to be 
>> binary?  The .decode on the 
>>
>> if to_native(rtn['unique_key']) == to_native(self.unique_key):
>>
>> was to convert it from binary to test against the string stored in 
>> self.unique_key.
>>
>> Also, this fix isn't working in my python 2 installation.  I'm getting 
>> other errors there but haven't had time to dig through it enough.
>>
>> But, I really appreciate you taking a look.  To me, this is a huge 
>> problem that needs to be resolved.  Or, we have to stop using redis for 
>> sessions or the web2py redis layer completely.
>>
>> -Jim
>>
>>
>> On Friday, November 15, 2019 at 12:45:44 PM UTC-6, Leonel Câmara wrote:
>>>
>>> I haven't tried it, but I think the best fix is not to make the decode 
>>> work by putting the obviously missing parenthesis. The fix is simply to 
>>> remove the .decode, because to_native should take care of it, so this:
>>>
>>> rtn = {to_native(k.decode): v for k, v in self.db.r_server.hgetall(key).
>>> items()}
>>>
>>> Would become
>>>
>>> rtn = {to_native(k): v for k, v in self.db.r_server.hgetall(key).items
>>> ()}
>>>
>>> The second decode you used is also probably wrong although it may work 
>>> with python 3. I would say it should be like this
>>>
>>> if to_native(rtn['unique_key']) == to_native(self.unique_key):
>>>
>>> If no one makes a pull request in the mean time, I'll probably have time 
>>> to test this later in the month and do it.
>>>
>>>

-- 
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/1b9ce729-dcc6-47e3-9148-8775a5fd0da8%40googlegroups.com.


[web2py] How to access db in a new thread ?

2019-11-28 Thread Marc Legendre
Hello,

I would like to access to the db variable declared in db.py in another 
thread but I get this error:

AttributeError: 'thread._local' object has no attribute 
'_pydal_connection_140400076448208_2359

Despite a lot of research, I can't find a way to make it work. Does anyone 
has an idea of how to counter this problem ?

-- 
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/c883427f-957f-44b2-a362-14f9635b8cd3%40googlegroups.com.


[web2py] Error on model db.py

2019-11-28 Thread Chuck G. Madamombe
I have attached the code and the error message. Please help!

-- 
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/acc0b1d3-c592-4078-89ff-ce7f1534774b%40googlegroups.com.


[web2py] Extraction of web2py configuration support

2019-11-28 Thread The Living Cosmos
I believe long ago the web2py configuration support was released 
separately. Could someone provide me with the link?

-- 
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/672ed902-aadf-4686-aa37-875e5051f21d%40googlegroups.com.


[web2py] New databse overwriting old one on app update

2019-11-28 Thread Guilherme Botelho
I have a simple web2py app deployed, and would like to be able to update it 
(by reistalling) without overwriting the existing database data with the 
test one from my development version, I've read a few other posts from this 
group, but none seemed to do the trick, any ideias on how to do it?

I've also tried playing with the migrations and fake_migrations but it also 
didn't do anything.

-- 
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/ca7aaefd-3087-4f60-beb3-72c08a986a2a%40googlegroups.com.


[web2py] Filter table by headers

2019-11-28 Thread Josh B
Hi,

Does anyone know how to add filters to table headers (so that the user can 
filter a table using table data from each column)?

I'm struggling doing it with  and I've seen some ideal solutions in 
java but they don't seem to work for me (see below).

Any help greatly appreciated - v new to programming!
Thanks
Josh

my table views:


Assigned to
Type
Priority
Project
Task description
Attachments
Due Date


{{for row in rows:}}


{{=row.auth_user.FullName}}
{{=row.tasklist.jobtype}}
{{=row.tasklist.priority}}
{{=row.tasklist.projectid}}
{{=row.tasklist.heading}}
{{=row.tasklist.attachment}}
{{=row.tasklist.duedate}}

{{pass}}


java:

   1.   
   2. //  
   11.   

-- 
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/999fbe82-26c0-4218-ac49-073fea72e4ce%40googlegroups.com.


[web2py] web2py on an existing PostgreSQL Database?

2019-11-28 Thread Ulrich Goebel
Hi,

I have an existing PostgreSQL Database with about 20 tables, using 
collating sequences, foreign keys, triggers, and even additional indexes. 
For that database I want to write a WEB-frontend to insert, update and 
delete data in the database. I don't want to define the data model in 
python or web2py, but want to make django/python work on the existing 
database.

Is that possible? Where to find som helpful hints how to do that?

Best regards
Ulrich

-- 
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/e0d13a8c-37b7-45b7-a3ca-17fbbee22cd1%40googlegroups.com.


[web2py] How do you update a deployed app?

2019-11-28 Thread Guilherme Botelho
I have an app which is currently running on Pythonanywhere, and would like 
to know if there is an easy way to update it without messing up the 
database.

I usually work on my project using SelfHost, then I package it and 
overwrite the one running in the Pythonanywhere server with the new 
version. I can afford to do this for now as it is still in testing, but I 
would like to know if there is a simple way to release updates to an app 
which has to keep it's database unchanged through the update.

Thanks!

-- 
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/dbd17757-e647-46e0-8d9f-14eda3b9249f%40googlegroups.com.


[web2py] vscode with web2py

2019-11-28 Thread william vegas
Hello guys. Any of you have configured vscode to work with web2py? that it 
recognizes all the methods and so on. Do you know any video or guide? Any 
help would be appreciated! Thanks! 

-- 
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/84143729-a41d-4f26-8eba-b44dd86c0ad9%40googlegroups.com.


[web2py] Re: Optimization web2py app

2019-11-28 Thread dirman

See post link:

https://groups.google.com/d/msg/web2py/W4cbtIDNoSA/Lb0bTJilAgAJ


On Sunday, April 21, 2019 at 9:06:37 AM UTC+1, Константин Комков wrote:
>
> Hello! Are anybody use tecnology - progressive web app(PWA)? Can you tell 
> where I can find .html file for using it in cache for service worker, 
> becouse I don't see them on tab network in google chrome.
> If we open site in google chrome, press f12 and go to tab Audit -> Run 
> audits. We can see that now in web2py 2.18.5 we use bootstrap 4.0.0 which 
> contain one medium vulnerability.
> Web2py book contain medium vulnerability too in jquery 1.10.2.
>
> Best regards, Konstanten
>

-- 
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/bc09a6be-e578-4790-a66e-19d9f3b1c95d%40googlegroups.com.


[web2py] Re: Getting a PWA set up based on web2py

2019-11-28 Thread dirman
You can also use this approach 
https://groups.google.com/d/msg/web2py/W4cbtIDNoSA/Lb0bTJilAgAJ. It works 
fine for me.

On Friday, October 11, 2019 at 7:06:26 AM UTC+1, mostwanted wrote:
>
> Hi @Valdeck Rowe,  i wan to know if this approach worked for you in your 
> PWA  development. Were there any developments or changes to this approach? 
> I am asking because i was hoping to use your approach in my desperate 
> attempt at making one of my apps a PWA.
>
> Regards;
>
> Mostwanted
>
> On Wednesday, October 10, 2018 at 11:25:25 AM UTC+2, Valdeck Rowe wrote:
>>
>>
>> I decided to use upup.js by Tal Ater, website here: 
>> https://www.talater.com/upup/getting-started-with-offline-first.html, 
>> mainly because I had a project deadline and needed something with a short 
>> learning curve.
>>
>> The main thing about PWAs appears to be that the service worker 
>> javascript files need to be accessible from the domain root.
>>
>> Warning - this is all very hackish - I wasn't sure how to get a file to 
>> appear as if it was on the actual domain root.
>>
>> I tried setting it up using a controller to serve as the base for the JS 
>> and manifest files in order to mimic the root.
>>
>> This is the controller setup:
>> def manifest():
>> item = db(db.item.id > 0).select().first()
>> return locals()
>>
>>
>> def upup():
>> return locals()
>>
>>
>> def upup_sw():
>> return locals()
>>
>> 
>>
>> manifest.json
>> {
>>   "name": "{{=item.name}}",
>>   "short_name": "{{=item.slugname}}",
>>   "theme_color": "#2196f3",
>>   "background_color": "rgba(243,216,33,0.62)",
>>   "display": "standalone",
>>   "Scope": "/app2/items/",
>>   "start_url": "/app2/items/",
>>   "icons": [
>> {
>>   "src": "{{=URL('static', 'images/icons/icon-72x72.png', 
>> scheme='https', host=True)}}",
>>   "sizes": "72x72",
>>   "type": "image/png"
>> },
>> {
>>   "src": "{{=URL('static', 'images/icons/icon-96x96.png', 
>> scheme='https', host=True)}}",
>>   "sizes": "96x96",
>>   "type": "image/png"
>> },
>> {
>>   "src": "{{=URL('static', 'images/icons/icon-128x128.png', 
>> scheme='https', host=True)}}",
>>   "sizes": "128x128",
>>   "type": "image/png"
>> },
>> {
>>   "src": "{{=URL('static', 'images/icons/icon-144x144.png', 
>> scheme='https', host=True)}}",
>>   "sizes": "144x144",
>>   "type": "image/png"
>> },
>> {
>>   "src": "{{=URL('static', 'images/icons/icon-152x152.png', 
>> scheme='https', host=True)}}",
>>   "sizes": "152x152",
>>   "type": "image/png"
>> },
>> {
>>   "src": "{{=URL('static', 'images/icons/icon-192x192.png', 
>> scheme='https', host=True)}}",
>>   "sizes": "192x192",
>>   "type": "image/png"
>> },
>> {
>>   "src": "{{=URL('static', 'images/icons/icon-384x384.png', 
>> scheme='https', host=True)}}",
>>   "sizes": "384x384",
>>   "type": "image/png"
>> },
>> {
>>   "src": "{{=URL('static', 'images/icons/icon-512x512.png', 
>> scheme='https', host=True)}}",
>>   "sizes": "512x512",
>>   "type": "image/png"
>> }
>>   ],
>>   "splash_pages": null
>> }
>>
>>
>>
>> upup.js # I simply copied the contents
>> //! UpUp
>> //! version : 1.0.0
>> //! author  : Tal Ater @TalAter
>> //! license : MIT
>> //! https://github.com/TalAter/UpUp
>> (function(e){"use strict";var t=navigator.serviceWorker;if(!t)return this
>> .UpUp=null,e;var n={"service-worker-url":"{{=URL('items', 'upup_sw.js', 
>> scheme=True, )}}"},r=!1,s="font-weight: bold; color: #00f;";this.UpUp={
>> start:function(e){this.addSettings(e),t.register(n["service-worker-url"
>> ],{scope:"./app2/items/"}).then(function(e){r&&console.log("Service 
>> worker registration successful with scope: %c"+e.scope,s);(e.installing||
>> t.controller||e.active).postMessage({action:"set-settings",settings:n
>> })}).catch(function(e){r&&console.log("Service worker registration 
>> failed: %c"+e,s)})},addSettings:function(t){"string"==typeof(t=t||{})&&(t
>> ={content:t}),["content","content-url","assets","service-worker-url",
>> "cache-version"].forEach(function(r){t[r]!==e&&(n[r]=t[r])})},debug:
>> function(e){r=!(arguments.length>0)||!!e}}}).call(this);
>> //# sourceMappingURL=upup.js.map
>>
>>
>>
>> upup_sw.js
>> //! UpUp Service Worker
>> //! version : 1.0.0  
>> //! license : MIT
>> //! https://github.com/TalAter/UpUp
>> var _CACHE_NAME_PREFIX="upup-cache",_calculateHash=function(e){var t,n=0,
>> s=(e=e.toString()).length;if(0===s)return n;for(t=0;t> charCodeAt(t),n|=0;return n};self.addEventListener("message",function(e){
>> "set-settings"===e.data.action&&_parseSettingsAndCache(e.data.settings
>> )}),self.addEventListener("fetch",function(e){e.respondWith(fetch(e.
>> request).catch(function(){return caches.match(e.request).then(function(t
>> ){return t||("navigate"===e.request.mode||"GET"===e.request.method&&e.
>> request.headers.get("accept").includes("text/html")?caches.match(
>> "sw-o

[web2py] Re: Progressive Web Apps

2019-11-28 Thread dirman

#view




  
  Hello World
  
  
  
  
  
  
  
  
  
  
  
  


  
Hello World!
  
  



Write functions to return the three files instead. Dont put actual files in 
static folder 

#controller
def manifest():
response.headers['Content-Type'] = 'text/json'
return  '''
{
  "name": "Hello World",
  "short_name": "Hello",
  "icons": [{
"src": "/pwa/static/images/hello-icon-128.png",
  "sizes": "128x128",
  "type": "image/png"
}, {
  "src": "/pwa/static/images/hello-icon-144.png",
  "sizes": "144x144",
  "type": "image/png"
}, {
  "src": "/pwa/static/images/hello-icon-152.png",
  "sizes": "152x152",
  "type": "image/png"
}, {
  "src": "/pwa/static/images/hello-icon-192.png",
  "sizes": "192x192",
  "type": "image/png"
}, {
  "src": "/pwa/static/images/hello-icon-256.png",
  "sizes": "256x256",
  "type": "image/png"
}, {
  "src": "/pwa/static/images/hello-icon-512.png",
  "sizes": "512x512",
  "type": "image/png"
}],
  "lang": "en-US",
  "start_url": "/pwa/",
  "display": "standalone",
  "background_color": "#DE3C4B",
  "theme_color": "#DE3C4B"
}
'''

def main():
response.headers['Content-Type'] = 'text/javascript'
return '''
window.onload = () => {
  'use strict';

  if ('serviceWorker' in navigator) {
navigator.serviceWorker
 .register('/pwa/sw.js');
  }
}
'''


def sw():
response.headers['Content-Type'] = 'text/javascript'
return '''
var cacheName = 'hello-pwa';
var filesToCache = [
  '/',
  '/pwa/',
  '/pwa/static/css/style.css',
  '/pwa/static/js/main.js'
];

/* Start the service worker and cache all of the app's content */
self.addEventListener('install', function(e) {
  e.waitUntil(
caches.open(cacheName).then(function(cache) {
  return cache.addAll(filesToCache);
})
  );
});

/* Serve cached content when offline */
self.addEventListener('fetch', function(e) {
  e.respondWith(
caches.match(e.request).then(function(response) {
  return response || fetch(e.request);
})
  );
});
'''


Access the page on http://localhost/pwa and  test locally using Devtools 
and not lighthouse. Would work fine as a WPA app 

On Thursday, December 13, 2018 at 9:09:21 AM UTC, mweissen wrote:
>
> I am just learning how to write Progressive Web Applications (PWA). I 
> think PWAs are a very important step towards app-like websites. There is a 
> lot of good examples on developers.google.com. One example has the 
> following structure:
>
> webroot
> |--images/
> |--scripts/
> |--styles/
> |--favicon.ico
> |--index.html
> |--manifest.json
> |--service-worker.js
>
> I want to use web2py to manage the datatables. What would be the best way 
> to combine the PWA file-tree with a web2py app?
>
> I have found only one (?) discussion about this topic at 
> https://groups.google.com/forum/#!topic/web2py/rHBfs1zFG44
>
> But there are some new questions:
>
>- My web2py server manages a lot of applications and it seems, that 
>the proposed solution accepts only one app with one service-worker.js and 
>so on.
>- All scripts would be visible to everybody at 
>http://mydomain.com/myapp/static/scripts. I think this not a good idea.
>
> Any ideas, any hints?
> Who has written PWAs with web2py?
>
> By the way: my next stept would be to use Preact together with PWAs. But 
> for now I want to go step by step...
>
>
> Regards Martin
>
>
>

-- 
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/4f5bd60a-6b42-4cc2-aaa0-be1d26cc102e%40googlegroups.com.


Re: [web2py] Re: Anyone have a sample haproxy.cfg file for haproxy v 1.8

2019-11-28 Thread Krishna Bavandlapally
Thank you Jim S for your support

-- 
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/40bf441d-4caf-4404-b4f8-2c09097f5fe8%40googlegroups.com.


Re: [web2py] Re: Anyone have a sample haproxy.cfg file for haproxy v 1.8

2019-11-28 Thread Krishna Bavandlapally
Okay, thank you for your Jim

-- 
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/171bff1e-9bda-44b9-a2ee-50f404a0dac7%40googlegroups.com.