[web2py] Re: web2py 2.14.1 beta

2016-03-22 Thread Jack Kuan
I assume these print statements(in *gluon/sqlhtml.py*), probably added 
while debugging, will be removed in the 2.14.1?

print dbset.query
print tablenames
   
print tables

Thanks

On Monday, March 21, 2016 at 6:38:16 PM UTC-4, Massimo Di Pierro wrote:
>
> Please help us check it (for testers version)
>
> http://web2py.com/init/default/download
>
> and let us know if it does not work with your code. I will be released as 
> stable in 2 days. So better check it sooner rather than later.
>
> Massimo
>

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


[web2py] PyCharm license for web2py dev - who wants?

2015-10-15 Thread Jack Kuan
+1 Would love to give it a try. 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Modifying web2py JS files -- best practices?

2015-08-08 Thread Jack Kuan
Replying to my post, adding a step 7) git pull -s subtree -X 
subtree=applications/welcome web2py master

It seems this step is necessary before any new commit after step 6 to let 
git know where we are in terms of merge to avoid conflicts later.

On Thursday, August 6, 2015 at 11:10:54 PM UTC-4, Jack Kuan wrote:

 Often the starting point of making a web2py app is to copy the welcome app 
 and base your repo on it.

 But as you add/modify/delete files from your repo that's based on the 
 welcome app to suit your need, you then face the problem of
 merging updates to the welcome app back to your repo.

 I did some googling and tests today, and found that using git subtree 
 merge seems to provide a nice solution to this problem.
 Here are the steps to create a new repo based on the welcome app:

 1) Create an empty git repo:
 mkdir myapp; cd myapp; git init

 2) Add a file(e.g., .gitignore or README.md) as the first commit.
 This first commit is required otherwise everything in web2py will be 
 added later.

 3) Add a web2py remote and fetch the repo
 git remote add -f web2py https://github.com/web2py/web2py

 4) Merge, using the 'ours' strategy, files from web2py's master branch 
 into our master, squash all commits into 1 commit,
 but don't commit, only create the tree object or something:

 git merge --squash -s ours --no-commit web2py/master

 5) Now add the above merge, taking only the applications/welcome tree, 
 into index, under the root(/):

 git read-tree --prefix=/ -u web2py/master:applications/welcome

 NOTE: here I specified /, which makes everything being added directly 
 under the root of the repo.
 But you can use app/, for example, to add the files of the 
 welcome app under a app/ directory of your repo instead.

 6) git commit

 Now you should have a repo that looks like the welcome app.
 If later the welcome app is updated in web2py, here's how you can merge 
 the changes to your repo:

 git pull -s subtree -X subtree=applications/welcome web2py master


 Hope this is useful
 Jack

 On Thursday, August 6, 2015 at 1:41:12 AM UTC-4, Joe Barnhart wrote:

 It seems more and more clear I'm going to be making changes to the 
 included web2py.js file.  I'm worried about keeping current when new 
 versions of web2py come out if I've mucked a lot with this javascript file.

 So what does everyone else do?  How do we customize the platform and 
 still keep current with its evolution?  Is there an accepted best 
 practice in this area?

 -- Joe



-- 
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: web2py 1.12.1 is out

2015-08-07 Thread Jack Kuan
surely you meant 2.12.1 ?

-- 
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: Modifying web2py JS files -- best practices?

2015-08-06 Thread Jack Kuan
Often the starting point of making a web2py app is to copy the welcome app 
and base your repo on it.

But as you add/modify/delete files from your repo that's based on the 
welcome app to suit your need, you then face the problem of
merging updates to the welcome app back to your repo.

I did some googling and tests today, and found that using git subtree merge 
seems to provide a nice solution to this problem.
Here are the steps to create a new repo based on the welcome app:

1) Create an empty git repo:
mkdir myapp; cd myapp; git init

2) Add a file(e.g., .gitignore or README.md) as the first commit.
This first commit is required otherwise everything in web2py will be 
added later.

3) Add a web2py remote and fetch the repo
git remote add -f web2py https://github.com/web2py/web2py

4) Merge, using the 'ours' strategy, files from web2py's master branch into 
our master, squash all commits into 1 commit,
but don't commit, only create the tree object or something:

git merge --squash -s ours --no-commit web2py/master

5) Now add the above merge, taking only the applications/welcome tree, into 
index, under the root(/):

git read-tree --prefix=/ -u web2py/master:applications/welcome

NOTE: here I specified /, which makes everything being added directly under 
the root of the repo.
But you can use app/, for example, to add the files of the 
welcome app under a app/ directory of your repo instead.

6) git commit

Now you should have a repo that looks like the welcome app.
If later the welcome app is updated in web2py, here's how you can merge the 
changes to your repo:

git pull -s subtree -X subtree=applications/welcome web2py master


Hope this is useful
Jack

On Thursday, August 6, 2015 at 1:41:12 AM UTC-4, Joe Barnhart wrote:

 It seems more and more clear I'm going to be making changes to the 
 included web2py.js file.  I'm worried about keeping current when new 
 versions of web2py come out if I've mucked a lot with this javascript file.

 So what does everyone else do?  How do we customize the platform and still 
 keep current with its evolution?  Is there an accepted best practice in 
 this area?

 -- Joe



-- 
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: Can we disable moderation in the group?

2015-03-12 Thread Jack Kuan
I too have a feeling that all my posts have been moderated because whenever I 
make a new post, I have to wait for hours or a day for it to show up in the 
group.

-- 
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] Can we disable moderation in the group?

2015-03-06 Thread Jack Kuan
I don't see the need and think it can be off putting for new comers.

-- 
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] Weird problems with scheduler on OSX

2015-03-06 Thread Jack Kuan
I have had a similar problem with the scheduler on OS X. Try search scheduler 
os x urllib in this group, and see if my post helps.

-- 
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: Weird problems with scheduler on OSX

2015-03-06 Thread Jack Kuan

Hi Joe,

Oh I'm sure web2py still uses urllib somewhere. Have you tried just adding 
the lines to gluon/widget.py and see if that helps?

Jack

On Friday, March 6, 2015 at 11:35:46 PM UTC-5, Joe Barnhart wrote:

 Hi Jack -- 

 I found that post and checked, but my web2py (v.2.9.12-stable) did not use 
 urllib to begin with.  Too bad, I thought I'd found a workaround!  Now I'll 
 have to do some heavy lifting and help Niphlod find the problem...

 -- Joe


 On Friday, March 6, 2015 at 6:12:30 PM UTC-8, Jack Kuan wrote:

 I have had a similar problem with the scheduler on OS X. Try search 
 scheduler os x urllib in this group, and see if my post helps. 



-- 
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] Running scheduler on OS X - problem with urllib.getproxies() and multiprocessing

2014-11-28 Thread Jack Kuan
Hi,

I'm just wondering if anyone has experienced the same problem or not. 
Basically, I get a segmentation fault (scheduler process killed by signal 
11) if I try to start more than one scheduler under OS X.
The problem can be reproduced with the built-in welcome app by adding a 
models/scheduler.py:

from gluon.scheduler import  Scheduler
SCHEDULER = Scheduler(db)
 
and then start the scheduler like this:

./web2py -K welcome,welcome


I'm running web2py R-2.9.11 with python 2.7.8 (also same result with 
apple's python 2.7.6) on OS X 10.10.1(also got the same result on Maverick).
I've managed to track down the problem to the getproxies() call in urllib 
which leads me to this bug: http://bugs.python.org/issue9405

By following the suggestion in the bug report, I was able to work around 
this problem by this patch:

diff --git a/gluon/widget.py b/gluon/widget.py
index cf885ae..62a38ee 100644
--- a/gluon/widget.py
+++ b/gluon/widget.py
@@ -1051,6 +1051,11 @@ def start_schedulers(options):
 print 'starting single-scheduler for %s...' % app_
 run(app_, True, True, None, False, code)
 return
+
+# Work around OS X problem: http://bugs.python.org/issue9405
+import urllib
+urllib.getproxies()
+
 for app in apps:
 app_, code = get_code_for_scheduler(app, options)
 if not app_:


Just wanted to throw this out in case anyone meets the problem.

Thanks
Jack

-- 
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] SQLFORM.grid search: how to show only a subset of available search fields?

2014-10-26 Thread Jack Kuan
Answering my own question: my solution is to massage the returned grid object, 
removing duplicate options and other unwanted html elements.

-- 
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] SQLFORM.grid search: how to show only a subset of available search fields?

2014-10-22 Thread Jack Kuan
Hi,

I'm using left=[...] when creating a searchable SQLFORM.grid. 
My problem is that the drop-down menu for choosing which fields to build 
the search query contains ALL the fields in the search result.
Is there a way to limit it to only a subset of the fields like what the 
'fields' argument of SQLFORM.grid() does for restricting the grid columns 
shown?

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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: question about db.mytable.update_or_insert()

2014-08-13 Thread Jack Kuan
How does one usually deal with such conflict? (two identical(except for 
id's) inserts causing a violation of an unique constraint)

Isolating the insert into its own transaction and then do a db.commit(), 
catch any exception and then ignore?

Thanks

On Wednesday, August 13, 2014 10:57:13 AM UTC-4, Niphlod wrote:

 the problem in concurrency (andduplication) isn't the update part, it's 
 the insert part

 On Wednesday, August 13, 2014 1:39:56 PM UTC+2, Leonel Câmara wrote:

 Couldn't he use a _for_update argument there to make this work in some 
 adapters?

 db.mytable.update_or_insert(q, name='test', _for_update=True)



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


[web2py] Record versioning without duplicate archive records?

2014-08-12 Thread Jack Kuan
Hi,

just starting out with web2py. Given a table with record versioning 
enabled, I find that for every successful update operation a row will be 
inserted in the archive table.
I'm using update_or_insert(), is it possible to make web2py only copy an 
old row into the archive table when there's a difference between the old 
row and the new row?


Thanks
Jack

-- 
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] question about db.mytable.update_or_insert()

2014-08-12 Thread Jack Kuan
Hi,

When using  update_or_insert(), say for example:  
db.mytable.update_or_insert(q, name='test')

Let's say the query, q, results in not finding any row in mytable, is it 
possible that in another transaction in another request that when the same 
update_or_insert(...) is called that it also doesn't find any row and thus 
at the end, the two transcations both try to commit an insert, which could 
result in duplicated rows(with different id's) or an integrity error(eg, if 
there's an unique constraint)? Or is web2py smart enough to generate an 
insert that is safe?

Thanks
Jack

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