[web2py] 2.18.5 globals.py Python 3 error

2020-01-30 Thread Yi Liu
gluon.globals.py has a python 3 bug, please see this issue for details. https://github.com/web2py/web2py/issues/2262 The issue reporter also provided a fix. Please consider include this fix in the next release. Thanks! -- Resources: - http://web2py.com - http://web2py.com/book

Re: [web2py] Re: request.requires_https() Python 3 bug

2019-03-18 Thread Yi Liu
t doesn't work. > Life is about taking risks. > Regards > > On Sat, 16 Mar 2019, 01:08 Yi Liu > wrote: > >> Thanks for replying. Sorry, Massimo, I am reluctant to upgrade on my >> server. I experience a major bug on my local web2py with 2.18 series, re: >>

[web2py] Re: request.requires_https() Python 3 bug

2019-03-15 Thread Yi Liu
server. On Thursday, March 14, 2019 at 8:51:04 PM UTC-7, Massimo Di Pierro wrote: > > can you please try 2.18.4? > > On Monday, 11 March 2019 18:16:25 UTC-7, Yi Liu wrote: >> >> I think this is a python 3 bug: >> >> I have >> >> request.requires_http

[web2py] request.requires_https() Python 3 bug

2019-03-11 Thread Yi Liu
I think this is a python 3 bug: I have request.requires_https() in a model file 1_server.py Then after I switch to Py3 recently, I start to collect these errors: Ticket ID 221.2.44.75.2019-03-10.23-16-34.b272289e-a41d-4c91-a730-2346995d4bdb write() argument must be str, not bytes Version

[web2py] Re: 2.18.3 blank logger message window. Mac users please chime in

2019-03-09 Thread Yi Liu
Hi, Leonel, Thanks for the suggestion. Unfortunately, I made the two changes. I also deleted the pyc file, it did not help. Still the same error. Thank you all the same. On Thursday, March 7, 2019 at 11:07:38 AM UTC-8, Leonel Câmara wrote: > > This is clearly a bug in web2py's messagebox

[web2py] Re: 2.18.3 blank logger message window. Mac users please chime in

2019-03-07 Thread Yi Liu
Further info: 1. This error is triggered whenever I access the admin login password interface. 2. I have a logger in a function. I have confirmed it is not the cause, since if I comment the whole function out, still get the same error. On Wednesday, March 6, 2019 at 7:09:28 PM UTC-8, Yi Liu

[web2py] 2.18.3 blank logger message window. Mac users please chime in

2019-03-06 Thread Yi Liu
Hi, previously I reported this Rocket error after switching to py3. It is still there and I can tolerate. After recent 2.18.3 update, a new error comes up. This one is more annoying.

[web2py] Re: web2py 2.18.3 is OUT

2019-03-04 Thread Yi Liu
Is this fix going to be included in next release? or we are on our own? Thanks! On Monday, March 4, 2019 at 9:45:27 AM UTC-8, Leonel Câmara wrote: > > Kevin I didn't test that, but this fix should indeed fix auth messages as > well since they're also LazyT objects that go into session.flash >

[web2py] another python 3 minor bug in 2.18.2: b'Logged in'

2019-02-26 Thread Yi Liu
b'Logged In' in flash message: [image: Screen Shot 2019-02-26 at 12.33.29.png] This is in auth, not something in my app, right? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: 2.18.1 is OUT

2019-02-26 Thread Yi Liu
fixed in 2.18.2 On Monday, February 25, 2019 at 4:38:21 PM UTC-8, Yi Liu wrote: > > A python 3 bug: > > 'dict' object has no attribute 'iteritems' > Version > web2py™ Version 2.18.1-stable+timestamp.2019.02.24.06.24.15 > Python Python 3.7.2: > /Users/LaVie/.pyenv/ve

[web2py] Re: 2.18.1 is OUT

2019-02-25 Thread Yi Liu
A python 3 bug: 'dict' object has no attribute 'iteritems' Version web2py™ Version 2.18.1-stable+timestamp.2019.02.24.06.24.15 Python Python 3.7.2: /Users/LaVie/.pyenv/versions/miniconda3-4.3.11/bin/python (prefix: /Users/LaVie/.pyenv/versions/miniconda3-4.3.11) Traceback 1. 2. 3. 4. 5. 6.

[web2py] Re: Rocket Error after (easy and successful) switch to Python 3

2019-02-18 Thread Yi Liu
is gone. I also check my previous web2py profiler log: utils.py(getipaddrinfo) takes 10 secs socket.py(getfqdn) takes 5 secs So it is some problem with my network settings. Thanks anyway. On Sunday, February 17, 2019 at 10:55:03 PM UTC-8, Yi Liu wrote: > > Thanks for reply, Massimo. > &g

[web2py] Re: Rocket Error after (easy and successful) switch to Python 3

2019-02-17 Thread Yi Liu
7 February 2019 22:15:36 UTC-8, Yi Liu wrote: >> >> Hi, I switch my server and local macbook web2py to Python 3 successfully >> without any change to web2py or applications, except minor 2to3 syntax >> changes. Amazing! >> >> On my local macbook, I start to hav

[web2py] Rocket Error after (easy and successful) switch to Python 3

2019-02-17 Thread Yi Liu
Hi, I switch my server and local macbook web2py to Python 3 successfully without any change to web2py or applications, except minor 2to3 syntax changes. Amazing! On my local macbook, I start to have this error in the terminal. And it seems does not affect anything at the app. All the app

[web2py] Re: Google analytics

2019-02-06 Thread Yi Liu
I reported this issue a year ago: https://groups.google.com/forum/#!searchin/web2py/analytics%7Csort:date/web2py/1_kCqFydZd8/kvywhYKUAQAJ Nobody replied to my post :) Recently, I upgrade to the analytics.min.js in 2.17.2, still does not work. So i am still using the analytics.min.js in 2.8.1.

[web2py] Re: what is the best practice for importing modules in a module?

2019-02-04 Thread Yi Liu
I agree. I am considering switch to pyGal. And Plotly is the only online plotting service though. Other options you have to serve your own plots. On Monday, February 4, 2019 at 8:51:43 AM UTC-8, Leonel Câmara wrote: > > To be honest I think this is bad enough of a problem that I would simply

[web2py] Re: what is the best practice for importing modules in a module?

2019-02-04 Thread Yi Liu
way? Put import custom module inside a model function? my new idea :) On Monday, February 4, 2019 at 5:28:04 AM UTC-8, Anthony wrote: > > On Monday, February 4, 2019 at 12:58:58 AM UTC-5, Yi Liu wrote: >> >> Thank you for your reply, Dave. If I understand you correctly, I al

[web2py] Re: Admin /default error

2019-02-03 Thread Yi Liu
This seems to be a typical py2 py3 transition utf-8 error. I personally encountered before/ some googling and stackoverflow reading should solve your problem. On Sunday, February 3, 2019 at 2:52:51 AM UTC-8, Maurice Waka wrote: > > I'm shifting my app to python3.6. > When trying to edit from

[web2py] Re: what is the best practice for importing modules in a module?

2019-02-03 Thread Yi Liu
s-when-you-import-inside-of-a-function I am not sure this is unique tip to web2py. Hope my experience will be helpful to others. On Sunday, February 3, 2019 at 1:17:48 PM UTC-8, Dave S wrote: > > > > On Saturday, February 2, 2019 at 3:48:43 PM UTC-8, Yi Liu wrote: >> >> Dear

[web2py] what is the best practice for importing modules in a module?

2019-02-02 Thread Yi Liu
Dear fellow users, I have an app with a scheduler, it uses these modules: import nunumpy as np import pandas as pd pd.core.common.is_list_like = pd.api.types.is_list_like import pandas_datareader as web import requests import datetime from tenacity import retry, stop, wait import time, os import

[web2py] Re: Web2py Website seems like abandoned...

2019-01-31 Thread Yi Liu
Especially if we compare to our rival's website: https://www.djangoproject.com/ I wish web2py get more resources as django does. On Wednesday, January 30, 2019 at 3:53:11 AM UTC-8, Ramos wrote: > > hello all > > Its like it is for a long time > It deserves a new layout. > Whos is in for a

[web2py] demo apps on website broken

2019-01-31 Thread Yi Liu
There are a series of posts here about improving our website. And here is another one. The interactive demo sites at this location: http://www.web2py.com/demo_admin are broken, issuing: Internal errorTicket issued: unrecoverable

Re: [web2py] Re: Custom buttons and standard buttons

2018-02-17 Thread Yi Liu
/chapter/29/05/the-views#INPUT On Saturday, February 17, 2018 at 7:57:08 AM UTC-8, F.C. wrote: > > How do i change the class of a custom and/or standard form button. Is > there an example you can reference? Again, thank you for the assistance > > On Sat, Feb 17, 2018 at 09

[web2py] Re: Custom buttons and standard buttons

2018-02-17 Thread Yi Liu
They are already in default bootstrap style. _class='btn btn-primary' To customize, you can add your own css file, or edit the form constructor to add a new class, or id , or change to different bootstrap class to specific form button. For example: _class='btn btn-danger' Your browser's web

[web2py] Re: Trouble with reset password

2018-02-17 Thread Yi Liu
Hi, I reported the lost password issue here: https://github.com/web2py/web2py/issues/1842 It is fixed and will be in next release. On Wednesday, January 24, 2018 at 9:07:04 AM UTC-8, Julian Sanchez wrote: > > I'm having troubles with the reset password functionality and I'm hoping > you guys

[web2py] Re: Just a silly thread to say... thanks to all web2py developers team

2018-02-17 Thread Yi Liu
I cannot agree more. Web2py is so easy to use, and the support here is so genuine, friendly and patient. I wish the developers all the best! On Friday, February 9, 2018 at 1:42:10 AM UTC-8, Jaime Sempere wrote: > > Hi, > > this is gonna sound a littile silly, but I have been wanting to publish

[web2py] Google analytics does not work in 2.16.1 but does in an older app

2018-02-16 Thread Yi Liu
I haven't got any tracking from my Google analytics for my new website trialert.com. I thought new tracking might take some time. But it hasn't shown up any tracking for 2 weeks. Then today I tried to use analytics.min.js from an older app in the same web2py setup. It starts to show active

Re: [web2py] Re: auth.messages.verify_email html template

2018-02-03 Thread Yi Liu
For other people's reference, I ended up modifying gluon/tools.py. It is probably not a good practise. But it is the easiest solution. I edit register() and email_reset_password() modifying something like (depends on which one) message=self.messages.verify_email % d to

Re: [web2py] Re: auth.messages.verify_email html template

2018-02-02 Thread Yi Liu
Thanks for sharing. I really hope web2py can officially update the native function to allow modern html email for verification. I understand the contributors have priorities. Yi On Saturday, November 22, 2014 at 5:56:06 AM UTC-8, Lisandro wrote: > > Hi Jay Martin. Actually, I ended up coding

[web2py] Re: appadmin.py interpret represent differently than default.py, causing keyError or attributeError

2018-02-02 Thread Yi Liu
Thank you so much for your detailed explanation. You also solved my puzzle about the behavior of join tables. Amazing that you know I have join tables in default.py when I didn’t say it. Lol. Really appreciate your help. -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: appadmin.py interpret represent differently than default.py, causing keyError or attributeError

2018-02-01 Thread Yi Liu
I figured a work around: ``` if request.controller == 'default': ctID = ctID.t_trial.f_ctid else: ctID = ctID.f_ctid ``` It would be nice to fix from the source. On Thursday, February 1, 2018 at 6:39:37 PM UTC-8, Yi Liu wrote: > > Dear all, > > I have a field

[web2py] appadmin.py interpret represent differently than default.py, causing keyError or attributeError

2018-02-01 Thread Yi Liu
Dear all, I have a field with custom represent: ``` Field('f_lastupdate', type='string', label=T('Last Update'), represent=lambda value, row: lastUpdateDateFormat(value, row['t_trial']['f_ctid'])), ``` It is fine in the application (default.py), but not in appadmin when i admin the

[web2py] Re: 'truncate' broken in SQLTABLE with 'headers'.

2018-01-30 Thread Yi Liu
This is still not fixed as of 01/30/2018 On Tuesday, January 22, 2013 at 1:38:29 AM UTC-8, Mandar Vaze wrote: > > Just to revive the discussion, if SQLTABLE is passed a headers dict AND > truncate value, then truncate isn't honored. > > e.g > > mytable = SQLTABLE(somequery, >

[web2py] Re: appconfig.ini versus models/0.py

2018-01-26 Thread Yi Liu
email settings now in AppConfig.ini not 0.py Took me an hour to figure out. Hope this post can save other people 's time. On Wednesday, March 29, 2017 at 10:33:22 PM UTC-7, Nico de Groot wrote: > > The 0.db solution is the old approach. Nothing very wrong with it, but > the new approach is

[web2py] Re: Does web2py support reCAPTCHA v2?

2018-01-26 Thread Yi Liu
For anyone comes to this thread from Google, to be explicit: use Recaptcha2() instead of Recaptcha() use_ssl option is gone. The book needs to be updated, if I or somebody has time. v1 is no longer supported. On Wednesday, July 29, 2015 at 2:04:59 AM UTC-7, Niphlod wrote: > > there's

[web2py] Re: mobile menu not working?

2018-01-26 Thread Yi Liu
Thank you. I will make sure I check github in the future. On Friday, January 26, 2018 at 10:08:50 AM UTC-8, Paolo Caruccio wrote: > > Please try the solution in https://github.com/web2py/web2py/issues/1828 > > Regards. > > > -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] mobile menu not working?

2018-01-26 Thread Yi Liu
Dear all, I have latest web2py running at trialert.com Both my barebone app and welcome app at trialert.com/welcome have problem with mobile theme. The mobile menu at top right corner does not work, not clickable. Best, Yi -- Resources: - http://web2py.com - http://web2py.com/book

Re: [web2py] Forcing SSL/HTTPS

2018-01-25 Thread Yi Liu
I would like to update this highly ranked post: I created a new model secure.py and add: FORCED SSL # session.secure() if not request.is_https: redirect(URL(scheme='https', args=request.args, vars=request.vars)) # I skipped the

[web2py] Re: How to use Let's Encrypt with Web2Py on Apache

2017-09-10 Thread Yi Liu
Dug up this old thread. In case anybody wondering the same question about certbot/let's encrypt and web2py. 1. use `--standalone` as David advised. But you have to stop the webserver everytime you renew. 2. instead, you can use the standard `--webroot` method. Here, you need to edit your

[web2py] Passenger WSGI setup with pyenv on Dreamhost

2017-08-26 Thread Yi Liu
Dear all, After hours of research and testing, I would like to share my experience using pyenv + passenger wsgi + web2py on Dreamhost shared hosting as of 08.2017 What I did differently than most guide online is that I only have to edit .htaccess file (in domain root folder) with: Credit:

[web2py] Re: FOREIGN KEY constraint failed error when "Click to delete" user account

2016-01-26 Thread Yi Liu
g "on delete cascade" or I just find a new bug? :) Best, Yi On Monday, January 25, 2016 at 8:59:17 AM UTC-8, Massimo Di Pierro wrote: > > Do you still get the ticket if you remove the logic for the additional > form on the profile page? > > On Sunday, 24 January 2016 21

[web2py] Re: FOREIGN KEY constraint failed error when "Click to delete" user account

2016-01-25 Thread Yi Liu
Thank you for your suggestion, Massimo. I deleted the logic. The only thing under def user() is now: return dict(form=auth()) I also modified the logic in user.html by ''' '''. {{ ''' if request.args(0)=='profile': =H2('Your Filters:') =XML('Note: Filters are logically OR-gates (except

[web2py] FOREIGN KEY constraint failed error when "Click to delete" user account

2016-01-24 Thread Yi Liu
Dear fellow w2p users, First, thank you so much for providing this great app Web2Py for *free*. Recently I updated my app to allow user to delete account themselves. auth.settings.allow_delete_accounts= True Today, I received feedback from user that that function is broken on my site. Then

[web2py] Reference SQLFORM creating duplicate entries, only for new user

2014-11-04 Thread Yi Liu
Hi, I am updating my app and encountered this new database problem: Basically, my code defines a criteria table that refer to auth_user.id so that each user can set his criteria, or update it. Old code worked fine: db.define_table('auth_criteria', Field

[web2py] Re: Reference SQLFORM creating duplicate entries, only for new user

2014-11-04 Thread Yi Liu
I think I figured out... The problem was how I select the record. I adapted this code from the book without understanding it thoroughly (chapter 3, the image blog section): db.auth_criteria.user_id.default = auth.user.id record = db.auth_criteria(db.auth_criteria.user_id.default) It was fine

[web2py] What are .table files in sqlite databases?

2014-10-15 Thread Yi Liu
Dear all, I am trying to backup my sqlite databases using its backup API: sqlite3 storage.db .backup db.bak I noticed it made a copy of storage.db. But how about all those .tables files. I search about sqlite and web2py, seems nothing came up about them. Using ls -l, I can tell most these

[web2py] Re: What are .table files in sqlite databases?

2014-10-15 Thread Yi Liu
Thank you very much for your quick and complete answer, Leonel! -- Yi On Wednesday, October 15, 2014 4:13:33 PM UTC-7, Leonel Câmara wrote: Table files have nothing to do with sqlite. They are files generated by web2py with the table structure, to detect changes and perform migrations. You

[web2py] Re: Web2Py Book inconsistency and Reference to auth_user table has no recursive attributes

2014-09-17 Thread Yi Liu
Great. This is a really *thorough* answer. I appreciate it, Anthony. Let web2py stay focused, and let others (pandas etc.) do what they are good at :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Web2Py Book inconsistency and Reference to auth_user table has no recursive attributes

2014-09-16 Thread Yi Liu
web2py Shell 2.9.5-stable+timestamp.2014.03.16.02.35.39 In [1] : tos = db(db.auth_criteria.toSend ==1).select() In [2] : tos Rows (1) In [3] : for row in tos: print row.user_id.email Traceback (most recent call last): File /Users/LaViez/Documents/Python/web2py/gluon/contrib/shell.py, line

[web2py] Re: Web2Py Book inconsistency and Reference to auth_user table has no recursive attributes

2014-09-16 Thread Yi Liu
Thanks a lot, ... Niphlod. When I do a simpler version, the web shell will give me an error occured, please reload. when I try: print row.user_id.email. Then I basically have to restart web2py.py again to get the shell back. Reload won't work. I am wondering if auth tables has to be logged in

[web2py] Re: Web2Py Book inconsistency and Reference to auth_user table has no recursive attributes

2014-09-16 Thread Yi Liu
Following your suggestion, I looked up how to use ipython console shell mode. The key is to load models by -M. Ahah! I hope this -M option could be documented better in the book. Now I have my friend iPython with me. Recursive indeed works: In [5]: rowtosend =

[web2py] Re: Web2Py Book inconsistency and Reference to auth_user table has no recursive attributes

2014-09-16 Thread Yi Liu
New function suggestion: Is it possible to return a list of field (column-wise) values without iterating through the rows? Currently, to get a column of selected rows, you have to do a for loop to collect them. It is very convenient to select column in numpy arrays or pandas dataframes. I

[web2py] Re: How to send email of registration verification and reset password by my function not by auth

2014-09-13 Thread Yi Liu
Thanks. Can you be more explicit? My problem here is my limited understanding of class, instance and method arguments. Not web2py: If I use my own mailer, I can use mailer.settings to set SMTP server info. But how do I customize send() arg - headers - for registration and reset_pwd email? I

[web2py] Re: How to send email of registration verification and reset password by my function not by auth

2014-09-13 Thread Yi Liu
well, sorry for answering myself: I found a workaround using functools.partial: from functools import partial mail = Mail() mail.send = partial(mail.send, headers={'X-MC-Template':'my-template'}) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Unable to install certain application when overwrite existing

2014-09-05 Thread Yi Liu
Hi, I got this error message Unable to install application when overwrite existing. Check box checked for overwrite. I tried to kill web2py sessions and restart both admin and the scheduler session, as Google suggested. No luck. I tried to overwrite another simpler app. Then it was fine. So

[web2py] Re: Unable to install certain application when overwrite existing

2014-09-05 Thread Yi Liu
Update: I happen to solve this problem by not include .git .DS_STORE in the pack custom. So this problem may have something to do with .git folder. Hope this help other people in the future. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Scheduler repeat time drift

2014-09-01 Thread Yi Liu
Hi, any updates on Cron_style scheduler? Scheduler is definitely more powerful than cron? Unfortunately, it cannot do what cron can do simply :( I am developing a web app that scrapes a page at 9am every day. Really wish scheduler can do this easily. I also read your comments here:

[web2py] Re: Scheduler repeat time drift

2014-09-01 Thread Yi Liu
Just read carefully and found that in the book. Thanks! On Monday, September 1, 2014 12:53:29 AM UTC-7, Niphlod wrote: prevent_drift is yet on core since 2.8.2 On Monday, September 1, 2014 8:11:18 AM UTC+2, Yi Liu wrote: Hi, any updates on Cron_style scheduler? Scheduler is definitely

[web2py] Re: OpenShift supports web2py

2013-12-16 Thread Yi Liu
Hi, Massimo, Is it possible for a better documentation for Openshift support? The link above is dead on web2py. Andrew Replogle made a cartridge, but it's not maintained anymore. I tried to manually update web2py by various stupid ways, no luck. I commented on his github page:

[web2py] Re: OpenShift supports web2py

2013-12-16 Thread Yi Liu
into it. On Monday, 16 December 2013 17:09:19 UTC-6, Yi Liu wrote: Hi, Massimo, Is it possible for a better documentation for Openshift support? The link above is dead on web2py. Andrew Replogle made a cartridge, but it's not maintained anymore. I tried to manually update web2py by various stupid ways