[web2py] Mulitple left join: unsupported query?
I have tried to translate this query: select A.id, A.surname, A.firstname, A.name, A.birthdate, A.race, A.gender, A.address, C.title as Journal, C.subject from akb_authors A left join akb_authors_article_link B on (B.author = A.uuid) left join akb_articles D on (D.uuid = B.article) left join akb_journal C on (C.uuid = D.journal) where A.id in (507182, 788825) to DAL: query = db.akb_authors.id.belongs(ids) left = (db.akb_authors_article_link.on(db.akb_authors.uuid == db.akb_authors_article_link.author), db.akb_articles.on(db.akb_articles.uuid == db.akb_authors_article_link.article), db.akb_journal.on(db.akb_journal.uuid == db.akb_articles.journal)) fields = [db.akb_authors.id, db.akb_authors.surname, db.akb_authors.firstname, db.akb_authors.name, db.akb_authors.birthdate, db.akb_authors.gender, db.akb_authors.race, db.akb_authors.address, db.akb_journal.title, db.akb_journal.subject ] headers = {'akb_journal.title': 'Journal'} form = SQLFORM.grid(query, fields=fields, maxtextlength = 100, deletable = False, editable = False, details = False, create = False, headers = headers, left = left, selectable = lambda ids: hanteer_verfyning(ids.id), orderby = db.akb_authors.id) but it ignores all the fields that are not in the first table and prints 'unsupported query' on the screen: SELECT akb_authors.id, akb_authors.surname, akb_authors.firstname, akb_authors.name, akb_authors.birthdate, akb_authors.gender, akb_authors.race, akb_authors.address FROM akb_authors LEFT JOIN akb_authors_article_link ON (akb_authors.uuid = akb_authors_article_link.author) LEFT JOIN akb_articles ON (akb_articles.uuid = akb_authors_article_link.article) LEFT JOIN akb_journal ON (akb_journal.uuid = akb_articles.journal) WHERE (akb_authors.id IN (507182,788825)) ORDER BY akb_authors.id; So how do I get the grid to show the two fields in akb_journal for me? Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3)
Re: [web2py] web2pyslice auth error
It's OK now. 2012. március 12., hétfő 23:35:15 UTC+1 időpontban rochacbruno a következőt írta: OK, I found the problem and I will fix it soon. Thanks for reporting. On Mon, Mar 12, 2012 at 4:57 PM, szimszon szims...@gmail.com wrote: Hi! I was on the page and I tried to update a slice but got the http://www.web2pyslices.com/admin/default/ticket/init/80.99.230.108.2012-03-12.16-43-41.f19c427c-46c8-4120-a189-29f2707ad6d7ticket :( No I suddenly logged out and if I try to log in via google I got the google page with access request and I push OK then I got a facebook auth page :( -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: Differentiating between URLs in web2py controllers
Yes, I can differentiate b/w /user/login and user/login?code= But Facebook in some cases redirects to user/login?code= which I am able to handle successfully. In other cases it redirects to user/login#_=_ in which case my code fails. Can you think of a solution to this? Thanks Saurabh On Tuesday, March 13, 2012 4:56:23 AM UTC+5:30, pbreit wrote: I don't think you can differentiate between /user/login and /user/login# But you can easily differentiate between /user/login and user/login?code= Note: /user/login?code= and /user/login#_=_?code= will look identical to the server. The # tells the browser (and only the browser) where to scroll to show the anchor. if request.vars.code: ...
[web2py] Re: Differentiating between URLs in web2py controllers
Yes, That is a solution but not the most elegant one :( Saurabh On Monday, March 12, 2012 8:20:12 PM UTC+5:30, Anthony wrote: Actually we are implementing FB login for our app. For this we want to detect whether /user/login controller was a redirect from facebook (after authentication) or a a user noramlly opened /user/login in their browser. Sometimes FB reidrects to /user/login#_=_ and sometimes to /user/login?code= [ Change in Session Redirect Behavior. This week, we started adding a fragment #_=_ to the redirect_uri when this field is left blank. Please ensure that your app can handle this behavior. https://developers.facebook.com/blog/post/552/ ] How can I differentiate b/w the two? I'm not sure you can when the request is first made, as the server only receives a request for /user/login, even if FB redirects to /user/login#_=_. After the redirect, you could use Javascript on the client side to see if there is a hash in the URL (e.g., using window.location.hash), and then possibly send an Ajax request to get the appropriate data in either case. Anthony
[web2py] Re: web2py recipe book
i just ordered the ebook , but i dont know how to download it , i payed and everything but how can i get the pdf ??
Re: [web2py] web2pyslice auth error
That's weired with my laptop I got redirected to facebook but not with my desktop pc :-o I deleted _all_ cookies from laptop but no effect :( 2012. március 13., kedd 9:26:43 UTC+1 időpontban szimszon a következőt írta: It's OK now. 2012. március 12., hétfő 23:35:15 UTC+1 időpontban rochacbruno a következőt írta: OK, I found the problem and I will fix it soon. Thanks for reporting. On Mon, Mar 12, 2012 at 4:57 PM, szimszon szims...@gmail.com wrote: Hi! I was on the page and I tried to update a slice but got the http://www.web2pyslices.com/admin/default/ticket/init/80.99.230.108.2012-03-12.16-43-41.f19c427c-46c8-4120-a189-29f2707ad6d7ticket :( No I suddenly logged out and if I try to log in via google I got the google page with access request and I push OK then I got a facebook auth page :( -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: Multiple Login methods
Hi Hassan please refer this link i think it will be useful for you :- http://www.web2py.com/books/default/chapter/29/9#Integration-with-OpenID,-Facebook,-etc. On Monday, March 12, 2012 8:30:36 PM UTC+5:30, Hassan Alnatour wrote: Dear ALL, I want to use Facebook and linked in and open iD and the normal auth form form login and registration , how can i do that and when i use this things for my website where dose the user register ?? Best Regards,
[web2py] Re: Auth.user is still NULL after a successful login
Hi, I studied the source code of auth.login() and found that all the validations are applied within the login method itself. The error message is automatically written to an element of class flash via setting session.flash to auth.messages.invalid_login. I modified my view code to include the class attribute of the td and set its value to flash as below: td class=flash{{=response.flash}}/td Now one can modify the CSS and JS to control how the element is displayed. As far as I understand, to achieve the required functionality of displaying form errors via form.errors.email etc., one can either extend Auth and override the login() method or build a custom login functionality. Let me know if there is an easier way On Tuesday, March 13, 2012 11:02:54 AM UTC+5:30, Sushant Taneja wrote: Hi, Ah, I forget that form.custom.begin is an XML object (more like a string) and doesn't change when you directly manipulate the form object itself. You could do: f.custom.begin = '%s id=login' % f.custom.begin[:-1] I added the above code line in controller. The attribute id was added to the form element, but the whole form being tag was rendered as : ** form method=post id=login** * * i.e form is displayed a text element and hence JS was not working on it. if login_form.errors: login_form.errors.email='Email/Password does not match' return dict(login_form=login_form) In the view I have : tr class=error td colspan=2!-- Show error here --/td /tr Maybe something like: {{if login_form.errors.email:}} tr class=error td colspan=2{{=login_form.errors.email}}/td /tr {{pass}} I didn't want to render the tr element dynamically, so I tried the following: tr class=error td colspan=2 {{if login_form.errors:}} {{=login_form.errors.email}} {{pass}} /td /tr But nothing is happening. In usual cases, if I leave the field empty or enter an invalid email address, an error is displayed but not in this case. Even if there are errors, the *login_form.errors* object is empty and nothing is displayed. How does auth handle authentication errors ?
[web2py] raspberry pi
it would be nice to be able to install web2py in raspberry pi http://www.raspberrypi.org/
Re: [web2py] raspberry pi
I see no problem to install Python and web2py on this, You just need to boot from an SD card with python and web2py on it. 2012/3/13 António Ramos ramstei...@gmail.com it would be nice to be able to install web2py in raspberry pi http://www.raspberrypi.org/ -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] Re: Upgrading web2py in Linux
I assume that you have only one application and you keep it separate from web2py: $HOME/workspace/my-project/src -- your application folder $HOME/workspace/my-project/web2py -- web2py folder To upgrade web2py to a desired version you can run then the following script. It pulls the changes from the repository and applies them to web2py folder. The it copies the global configuration files (which has been overwritten during update) from the application src folder (yaml files are only needed for GAE apps). Finally, it creates symbolic link to your application from within the web2py folder. #!/bin/bash TAG=R-1.99.7 cd $HOME/workspace/my-project # update files from repo cd web2py hg pull hg update -C $TAG cd .. # copy config files cp -p src/private/*.yaml web2py/. cp -p src/private/routes.py web2py/. # link to my application if [ ! -d web2py/applications/init ] then cd web2py/applications/ ln -s ../../src init fi Notice that your application will be linked as init. If you have more than one application per web2py instance, adjust the script to link all applications. Also, you will need mercurial installed to run the script (sudo apt-get install mercurial). And one more thing, this is perfectly normal that you need to mange the changes carefully. So there is no need to be bitter. BTW, there was an attempt by Jose to package web2py for Debian. It's pretty good but stays a bit behind the upstream: http://packages.debian.org/sid/python-web2py
Re: [web2py] web2py talk at PyCon US 2012 [video]
Thanks a lot! http://pyvideo.org/video/714/web2py-ideas-we-stole-and-ideas-we-had
Re: [web2py] Re: Upgrading web2py in Linux
2012/3/13 Wikus van de Merwe dupakrop...@googlemail.com: I assume that you have only one application and you keep it separate from web2py: $HOME/workspace/my-project/src -- your application folder $HOME/workspace/my-project/web2py -- web2py folder To upgrade web2py to a desired version you can run then the following script. It pulls the changes from the repository and applies them to web2py folder. The it copies the global configuration files (which has been overwritten during update) from the application src folder (yaml files are only needed for GAE apps). Finally, it creates symbolic link to your application from within the web2py folder. #!/bin/bash TAG=R-1.99.7 cd $HOME/workspace/my-project # update files from repo cd web2py hg pull hg update -C $TAG cd .. # copy config files cp -p src/private/*.yaml web2py/. cp -p src/private/routes.py web2py/. # link to my application if [ ! -d web2py/applications/init ] then cd web2py/applications/ ln -s ../../src init fi Notice that your application will be linked as init. If you have more than one application per web2py instance, adjust the script to link all applications. Also, you will need mercurial installed to run the script (sudo apt-get install mercurial). And one more thing, this is perfectly normal that you need to mange the changes carefully. So there is no need to be bitter. BTW, there was an attempt by Jose to package web2py for Debian. It's pretty good but stays a bit behind the upstream: http://packages.debian.org/sid/python-web2py Actually, not too behind, I've just upoaded the latest version, it will be available as soon as the mirrors synchronize ,)
[web2py] Re: subdomain routes for websites
What is the purpose of the demo version there? Wouldn't it be easier to have a separate demo controller? You could then simply define the default for the domains as: routers = dict( BASE = dict( domains = {domain.com:app, demo.domain.com:app/demo/index}, default_application = 'app', default_controller = 'org', default_function = 'index' ) )
[web2py] Re: web2py recipe book
Amazon just cancelled my order. They apparently don't have any in stock on the day it was supposed to ship. Guess im going directly to packt On Monday, March 12, 2012 3:18:43 AM UTC-4, Massimo Di Pierro wrote: The web2py recipes book is finally out: http://www.packtpub.com/web2py-application-development-recipes-to-master-python-web-framework-cookbook/book Congratulations to all those who contributed. Massimo
[web2py] apologies
About the PyCon talk. I apologize to all of you who should have been mentioned and were not. I took the list of contributors from web2py.com/examples/default/who and generated a word map from it. If you are not listed on that page and you feel you should be, please email me. Any omission is an oversight, not intentional. Massimo
Re: [web2py] apologies
Relax, Itś workś. Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil 2012/3/13 Massimo DiPierro massimo.dipie...@gmail.com About the PyCon talk. I apologize to all of you who should have been mentioned and were not. I took the list of contributors from web2py.com/examples/default/who and generated a word map from it. If you are not listed on that page and you feel you should be, please email me. Any omission is an oversight, not intentional. Massimo
[web2py] Re: web2py site and disabling browser right clicks
Well I have these two files attached with my pyjamas application bootstrap.js and bootstrap_progress.js. These are from the same web2py - pyjamas application example that is available online. I happened to try it. I find that although they have code in js, I don't find the database parameters. Still, I am only exploring these options so coming to a pre-mature conclusion would not be great. I'll explore this and get back. Thanks, Sincerely, Rahul D. [www.flockbird.com] On Tuesday, March 13, 2012 4:46:57 AM UTC+5:30, pbreit wrote: I still don't understand what your concern is. That HTML source paints the form! There's nothing more to be hidden since all fo the fields can be manipulated by filling out the form. The one hidden field is Web2py's form security ID which if manipulated will actually prevent a phony submission. I think you need to quickly come to the understanding that HTML source can not be hidden. Ever. Period. And move on. bootstrap_progress.js Description: JavaScript source bootstrap.js Description: JavaScript source
[web2py] Installing PIL for creating thumbnails in windows7 environment
Hi, I unable to install PIL in win for web2py .I came to know some commands like ( sudo apt-get install python-imaging,sudo easy_install PIL and sudo pip install PIL) but I think these are only applicable for linux environment if there is any possibility to install PIL in win it would be fine
[web2py] SQLForm
I have a table with a user id, an item id, and a permission level. I am trying to generate a form using SQLForm to change the permission level. The problem is I still want the user id and the item id to show up, but I don't want them to be editable. I would have thought setting writeable to false would have accomplished that, but the field still showed up as editable. How would I go about doing this?
Re: [web2py] Installing PIL for creating thumbnails in windows7 environment
Download the installer from PIL site: http://www.pythonware.com/products/pil/ On Tue, Mar 13, 2012 at 12:25 PM, praveen krishna praveenchitne...@gmail.com wrote: Hi, I unable to install PIL in win for web2py .I came to know some commands like ( sudo apt-get install python-imaging,sudo easy_install PIL and sudo pip install PIL) but I think these are only applicable for linux environment if there is any possibility to install PIL in win it would be fine -- Massimiliano
[web2py] Re: Support for PyPy
Ok, a few more tests with pypy (jit enable) in the welcome app with the Web2py 1.99.3 (2011-12-09 16:18:03) stable - *not the latest * *PyPy* ab -n 50 -c 10 http://127.0.0.1:8000/welcome/ This is ApacheBench, Version 2.3 $Revision: 655654 $ Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient).done Server Software:Rocket Server Hostname:127.0.0.1 Server Port:8000 Document Path: /welcome/ Document Length:11187 bytes Concurrency Level: 10 Time taken for tests: 2.197 seconds Complete requests: 50 Failed requests:0 Write errors: 0 Total transferred: 580350 bytes HTML transferred: 559350 bytes Requests per second:22.76 [#/sec] (mean) Time per request: 439.358 [ms] (mean) Time per request: 43.936 [ms] (mean, across all concurrent requests) Transfer rate: 257.99 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect:00 0.4 0 1 Processing: 243 415 66.8420 545 Waiting: 243 415 66.8419 544 Total:244 415 66.7420 546 Percentage of the requests served within a certain time (ms) 50%420 66%439 75%459 80%468 90%515 95%537 98%546 99%546 100%546 (longest request) *PYTHON* ab -n 50 -c 10 http://127.0.0.1:8181/welcome/ This is ApacheBench, Version 2.3 $Revision: 655654 $ Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient).done Server Software:Rocket Server Hostname:127.0.0.1 Server Port:8181 Document Path: /welcome/ Document Length:11187 bytes Concurrency Level: 10 Time taken for tests: 2.984 seconds Complete requests: 50 Failed requests:0 Write errors: 0 Total transferred: 580400 bytes HTML transferred: 559350 bytes Requests per second:16.75 [#/sec] (mean) Time per request: 596.850 [ms] (mean) Time per request: 59.685 [ms] (mean, across all concurrent requests) Transfer rate: 189.93 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect:00 0.0 0 0 Processing: 218 496 368.84452984 Waiting: 211 493 368.94432984 Total:218 496 368.84452984 Percentage of the requests served within a certain time (ms) 50%445 66%467 75%491 80%512 90%558 95%620 98% 2984 99% 2984 100% 2984 (longest request) *NGINX + uWSGI* ab -n 50 -c 10 http://127.0.0.1:80/welcome/ This is ApacheBench, Version 2.3 $Revision: 655654 $ Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 127.0.0.1 (be patient).done Server Software:nginx/1.1.4 Server Hostname:127.0.0.1 Server Port:80 Document Path: /welcome/ Document Length:11187 bytes Concurrency Level: 10 Time taken for tests: 0.639 seconds Complete requests: 50 Failed requests:0 Write errors: 0 Total transferred: 578450 bytes HTML transferred: 559350 bytes Requests per second:78.23 [#/sec] (mean) Time per request: 127.829 [ms] (mean) Time per request: 12.783 [ms] (mean, across all concurrent requests) Transfer rate: 883.82 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect:00 0.0 0 0 Processing:24 116 22.9123 143 Waiting: 24 116 22.9123 143 Total: 24 116 22.9123 143 Percentage of the requests served within a certain time (ms) 50%123 66%124 75%127 80%127 90%131 95%131 98%143 99%143 100%143 (longest request) PyPy is faster, but probably the gain isn't justified yet. I've also include the combination of nginx + uwsgi that I found to be the fastest setup till now. On Monday, March 12, 2012 9:48:58 PM UTC, Anthony wrote: On Monday, March 12, 2012 5:02:00 PM UTC-4, Francisco Costa wrote: On Monday, March 12, 2012 7:46:50 PM UTC, Anthony wrote: Maybe related to this: https://bugs.pypy.org/issue1051. Have you tried 1.7? Nop, i've tried the last source from bitbucket Sorry, didn't notice you said no jit -- that's the issue. Anthony
Re: [web2py] Upgrading web2py in Linux
you have to set a parameters.py or parameters_443.py, you will find it in your backup in web2py folder. Richard On Mon, Mar 12, 2012 at 5:18 PM, horridohobbyist horrido.hobb...@gmail.comwrote: I followed your instructions, but when I try to access admin/default/index, I get the following error message: admin disabled because unable to access password file So apparently your instructions are incomplete. All I'm trying to do is update my production system as easily as possible. I don't want to reinstall everything, and I don't want to jump through hoops. On Monday, 12 March 2012 13:03:11 UTC-4, Richard wrote: I am strongly suggest to you to not updating that way. Or if you do so, backup your web2py folder before. What I usually do: download latest source from download page backup my staging/prod web2py installation remove the old installation : cd /home/www-data/ rm -Rf web2py/ Uncompress the new web2py zip in the folder /home/www-data/ Set permission : sudo chown -R www-data.www-data web2py/ Copy my app in : web2py/applications/my app Also set permission is required here. If you are only talking about the dev environnement, I just let the old web2py in a folder named with the version and add an other folder with the new version beside and unpack web2py new version there and bring my app in the new installation. You don't have to bother with permission since you are only use it for developpement. Richard On Mon, Mar 12, 2012 at 12:45 PM, horridohobbyist horrido.hobb...@gmail.com wrote: I'm currently running Version 1.99.2 on my Ubuntu Linux server. Is there an easy way to upgrade to the latest version (1.99.7)? My web2py installation says Checking for upgrades..., but it never finishes checking! I presume that if it were to finish checking, there would be a way to upgrade automatically? Thanks.
Re: [web2py] Upgrading web2py in Linux
You just have to copy the file in your new application and it should work. You can also create a new one, but I should have look to detail how to do it. Ask if you need it. Richard On Tue, Mar 13, 2012 at 9:40 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: you have to set a parameters.py or parameters_443.py, you will find it in your backup in web2py folder. Richard On Mon, Mar 12, 2012 at 5:18 PM, horridohobbyist horrido.hobb...@gmail.com wrote: I followed your instructions, but when I try to access admin/default/index, I get the following error message: admin disabled because unable to access password file So apparently your instructions are incomplete. All I'm trying to do is update my production system as easily as possible. I don't want to reinstall everything, and I don't want to jump through hoops. On Monday, 12 March 2012 13:03:11 UTC-4, Richard wrote: I am strongly suggest to you to not updating that way. Or if you do so, backup your web2py folder before. What I usually do: download latest source from download page backup my staging/prod web2py installation remove the old installation : cd /home/www-data/ rm -Rf web2py/ Uncompress the new web2py zip in the folder /home/www-data/ Set permission : sudo chown -R www-data.www-data web2py/ Copy my app in : web2py/applications/my app Also set permission is required here. If you are only talking about the dev environnement, I just let the old web2py in a folder named with the version and add an other folder with the new version beside and unpack web2py new version there and bring my app in the new installation. You don't have to bother with permission since you are only use it for developpement. Richard On Mon, Mar 12, 2012 at 12:45 PM, horridohobbyist horrido.hobb...@gmail.com wrote: I'm currently running Version 1.99.2 on my Ubuntu Linux server. Is there an easy way to upgrade to the latest version (1.99.7)? My web2py installation says Checking for upgrades..., but it never finishes checking! I presume that if it were to finish checking, there would be a way to upgrade automatically? Thanks.
[web2py] tropo Instant voice and sms with python code
check this out www.tropo.com nice!
[web2py] Re: SQLForm
Show your code. Note, it is writable, not writeable. Anthony On Tuesday, March 13, 2012 9:15:34 AM UTC-4, Brian F wrote: I have a table with a user id, an item id, and a permission level. I am trying to generate a form using SQLForm to change the permission level. The problem is I still want the user id and the item id to show up, but I don't want them to be editable. I would have thought setting writeable to false would have accomplished that, but the field still showed up as editable. How would I go about doing this?
[web2py] Re: web2py site and disabling browser right clicks
Well I have these two files attached with my pyjamas application bootstrap.js and bootstrap_progress.js. These are from the same web2py - pyjamas application example that is available online. I happened to try it. I find that although they have code in js, I don't find the database parameters. What database parameters? Are you talking about form fields? If there is a form submission, open the browser developer tools, submit the form, and you will be able to observe the outgoing request, including all post variables sent to the server -- you don't even have to look at the source code to know how the app sends form submissions. A hacker could then create their own spoofed post requests. Anyway, the details of how to construct and submit a form have to be represented somewhere in the HTML and/or JS code -- someone who knows Pyjamas will be able to figure it out. Again, you can make it more difficult for non-technical users to easily inspect your code, but you cannot prevent hackers from seeing what your client-side code is doing. Do not rely on client-side code obscurity as your only protection. Anthony
Re: [web2py] web2py recipe book
just ordered from packt :) On Monday, March 12, 2012 6:55:03 PM UTC-4, rochacbruno wrote: On Mon, Mar 12, 2012 at 12:10 PM, Bruce Wade bruce.w...@gmail.com wrote: The other book would be version 4 of the official manual. Bought it because I didn't think it would be free online until much later. The official manual online version is available in HTML for free since the version 1.0, the PDF and PaperBack is released under a fee. That is the way it works since the beginning, you only have to pay for a book if you are not satisfied with HTML version, and if you want to have it on mobile reader or in physical paper. Another reason to buy is that it is a way to thank Massimo for the free and excellent work he does developing, answering questions and documenting web2py since the beginning and also help him to buy some pots of caffeine, so he can be always awake answering our questions and fixing bugs :) If you see some PDF or digital version for free, so it is piracy, and there is nothing we can do to stop this, even this new cookbook may become available on download sites for free. In my point of view, buying books on amazon, packt or another bookstore is also good for web2py advertisement, publishers will ask us all to write more books and web2py will be more visible! If I have enjoyed an open source software and also if I get some money working with an open source software. I always consider giving donations, paying for beers and coffees and buying some related stuff. -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] Mulitple left join: unsupported query?
I think you need to use smartgrid for this kind of purpose, since smartgrid si suppose to be the samething of grid but allow to manage more than one table fk... Richard On Tue, Mar 13, 2012 at 3:39 AM, Johann Spies johann.sp...@gmail.comwrote: I have tried to translate this query: select A.id, A.surname, A.firstname, A.name, A.birthdate, A.race, A.gender, A.address, C.title as Journal, C.subject from akb_authors A left join akb_authors_article_link B on (B.author = A.uuid) left join akb_articles D on (D.uuid = B.article) left join akb_journal C on (C.uuid = D.journal) where A.id in (507182, 788825) to DAL: query = db.akb_authors.id.belongs(ids) left = (db.akb_authors_article_link.on(db.akb_authors.uuid == db.akb_authors_article_link.author), db.akb_articles.on(db.akb_articles.uuid == db.akb_authors_article_link.article), db.akb_journal.on(db.akb_journal.uuid == db.akb_articles.journal)) fields = [db.akb_authors.id, db.akb_authors.surname, db.akb_authors.firstname, db.akb_authors.name, db.akb_authors.birthdate, db.akb_authors.gender, db.akb_authors.race, db.akb_authors.address, db.akb_journal.title, db.akb_journal.subject ] headers = {'akb_journal.title': 'Journal'} form = SQLFORM.grid(query, fields=fields, maxtextlength = 100, deletable = False, editable = False, details = False, create = False, headers = headers, left = left, selectable = lambda ids: hanteer_verfyning(ids.id ), orderby = db.akb_authors.id) but it ignores all the fields that are not in the first table and prints 'unsupported query' on the screen: SELECT akb_authors.id, akb_authors.surname, akb_authors.firstname, akb_authors.name, akb_authors.birthdate, akb_authors.gender, akb_authors.race, akb_authors.address FROM akb_authors LEFT JOIN akb_authors_article_link ON (akb_authors.uuid = akb_authors_article_link.author) LEFT JOIN akb_articles ON (akb_articles.uuid = akb_authors_article_link.article) LEFT JOIN akb_journal ON (akb_journal.uuid = akb_articles.journal) WHERE (akb_authors.id IN (507182,788825)) ORDER BY akb_authors.id; So how do I get the grid to show the two fields in akb_journal for me? Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3)
Re: [web2py] Installing PIL for creating thumbnails in windows7 environment
I treid to install from http://www.pythonware.com/products/pil/ but it is asking to register python 2.7 I tried to register using the script given in link http://effbot.org/zone/python-register.htm but it is giving an error *** Unable to register! *** You probably have another Python installation! and in set up file of PIL it asking to enter python directory and installation directory I tried to paste the directory but I am unable to do so.Is it possible after registering the python 2.7? On Tuesday, March 13, 2012 2:32:43 PM UTC+1, Massimiliano wrote: Download the installer from PIL site: http://www.pythonware.com/products/pil/ Hi, I unable to install PIL in win for web2py .I came to know some commands like ( sudo apt-get install python-imaging,sudo easy_install PIL and sudo pip install PIL) but I think these are only applicable for linux environment if there is any possibility to install PIL in win it would be fine -- Massimiliano
Re: [web2py] Re: SQLForm
Ah! That would do it. Sigh its been a long day. Thanks! On Mar 13, 2012, at 11:31 , Anthony wrote: Show your code. Note, it is writable, not writeable. Anthony On Tuesday, March 13, 2012 9:15:34 AM UTC-4, Brian F wrote: I have a table with a user id, an item id, and a permission level. I am trying to generate a form using SQLForm to change the permission level. The problem is I still want the user id and the item id to show up, but I don't want them to be editable. I would have thought setting writeable to false would have accomplished that, but the field still showed up as editable. How would I go about doing this?
Re: [web2py] Re: SQLForm
I always think it should be writeable too (both are acceptable spellings of the word in English, though I think writable is actually more common). :-) On Tuesday, March 13, 2012 1:28:35 PM UTC-4, Brian F wrote: Ah! That would do it. Sigh its been a long day. Thanks! On Mar 13, 2012, at 11:31 , Anthony wrote: Show your code. Note, it is writable, not writeable. Anthony On Tuesday, March 13, 2012 9:15:34 AM UTC-4, Brian F wrote: I have a table with a user id, an item id, and a permission level. I am trying to generate a form using SQLForm to change the permission level. The problem is I still want the user id and the item id to show up, but I don't want them to be editable. I would have thought setting writeable to false would have accomplished that, but the field still showed up as editable. How would I go about doing this?
Re: [web2py] Time picker is not showing up on Appadmin page.
I think you need to setup validator to have date time picker to show up. Richard On Mon, Mar 12, 2012 at 9:44 PM, Kenny nis...@gmail.com wrote: Date and datetime pickers are working fine except time picker Field('start_time', 'time',notnull=True), is what I put. It doesn't give me any js calendar popup. Any help? thank you.
Re: [web2py] Installing PIL for creating thumbnails in windows7 environment
Hi Praveen, On Tue 13 Mar 2012 17:25:54 GMT, praveen krishna wrote: I treid to install from http://www.pythonware.com/products/pil/ http://www.pythonware.com/products/pil/ but it is asking to register python 2.7 I tried to register using the script given in link http://effbot.org/zone/python-register.htm but it is giving an error *** Unable to register! *** You probably have another Python installation! and in set up file of PIL it asking to enter python directory and installation directory I tried to paste the directory but I am unable to do so.Is it possible after registering the python 2.7? Are you running the source version of web2py, or have you downloaded the Windows distribution? If you are using the Windows version, its built-in Python interpreter will not be registered with the system such that the PIL installer can find it. You will probably find things simpler in the long run if you use the source version. If you do, you will need the PIL windows installer that matches the version of Python that you have installed. HTH -- Regards, PhilK 'a bell is a cup...until it is struck'
[web2py] LOAD() function breaking CSS animation
Hi, In my view index.html, I have two forms: auth.login() and custom forgot password form. Initially the login form is displayed with a Forgot Password link. When we click on the link the form flips(rotates using CSS) and the forgot password form is now displayed. The forgot password form is a SQLFORM.factory generated form and is loaded in the page via the following line of code: {{=LOAD('user','request_reset_password.load',ajax=False,ajax_trap=True)}} The flip animation i.e. CSS rotation works fine until the forgot password form is submitted. After submission, the CSS breaks The .load component is as follows: {{=forgot_pass_form.custom.begin}} table id='recover' tr td colspan='2'Give us your email id and we will send you a link to reset your password/td /tr tr td colspan='2'{{=forgot_pass_form.custom.widget.email_id}}/td /tr tr td*a href=# id=flipToLogin class=flipLinkBack to Login/a */td td{{=forgot_pass_form.custom.submit}}/td /tr tr td colspan='2' {{if forgot_pass_form.errors:}} div class=error{{=forgot_pass_form.errors.email_id}}/div {{pass}} /td /tr /table {{=forgot_pass_form.custom.end}} The bold code above is the link which causes the CSS rotation but after submission fails to do so Can somebody help me understand on what's happening ? Thanks, Sushant
Re: [web2py] Re: No models vs. conditional models -- what's the advantage?
WARNING with import and threading.local(): they were hot topics on the pycon webdev summit, and other frameworks are facing problems with them. They could be memory hungry and contention problems could arise, so they could have scalabillity issues too. I think the web2py way is not so bad, but we should find some way to cache the models. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com
Re: [web2py] Re: No models vs. conditional models -- what's the advantage?
Mariano, if you are saying that importing anything and using current object inside the modules that we are importing is a problem, so I guess we really have a big problem! Many small apps can rely on some basic model execution system, but even if cached it would be still strange to have all of them loaded in cache. One of the most brilhant features of Python and any other modern language is the namespaces feature. So I can't imagine a big app without relying on namespaces, modules, packages, classes etc.. Thats the best way for programming in Python, and IMO: also thats the best way for programming in web2py. If threading.locals() has a problem,I think the goal should be to solve that problem, not to cache the models or to create routing hacks. (* I think map models is a good idea, but it is not a solution) Do you have any further information about that issue? On Tue, Mar 13, 2012 at 4:06 PM, Mariano Reingart reing...@gmail.comwrote: WARNING with import and threading.local(): they were hot topics on the pycon webdev summit, and other frameworks are facing problems with them. They could be memory hungry and contention problems could arise, so they could have scalabillity issues too. I think the web2py way is not so bad, but we should find some way to cache the models. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] LOAD() function breaking CSS animation
can you share your CSS/ Javascript code regarding the *flipLink and **flipToLogin objects? * On Tue, Mar 13, 2012 at 4:04 PM, Sushant Taneja sushant.tanej...@gmail.comwrote: Hi, In my view index.html, I have two forms: auth.login() and custom forgot password form. Initially the login form is displayed with a Forgot Password link. When we click on the link the form flips(rotates using CSS) and the forgot password form is now displayed. The forgot password form is a SQLFORM.factory generated form and is loaded in the page via the following line of code: {{=LOAD('user','request_reset_password.load',ajax=False,ajax_trap=True)}} The flip animation i.e. CSS rotation works fine until the forgot password form is submitted. After submission, the CSS breaksWARNING with import and threading.local(): they were hot topics on the pycon webdev summit, and other frameworks are facing problems with them. They could be memory hungry and contention problems could arise, so they could have scalabillity issues too. I think the web2py way is not so bad, but we should find some way to The .load component is as follows: {{=forgot_pass_form.custom.begin}} table id='recover' tr td colspan='2'Give us your email id and we will send you a link to reset your password/td /tr tr td colspan='2'{{=forgot_pass_form.custom.widget.email_id}}/td /tr tr td*a href=# id=flipToLogin class=flipLinkBack to Login/a*/td td{{=forgot_pass_form.custom.submit}}/td /tr tr td colspan='2' {{if forgot_pass_form.errors:}} div class=error{{=forgot_pass_form.errors.email_id}}/div {{pass}} /td /tr /table {{=forgot_pass_form.custom.end}} The bold code above is the link which causes the CSS rotation but after submission fails to do so Can somebody help me understand on what's happening ? Thanks, Sushant -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] LOAD() function breaking CSS animation
Hi, Below is the CSS Code: #formContainer{ width:288px; min-height:100px; margin:0 auto; position:relative; z-index:1; -moz-perspective: 800px; -webkit-perspective: 800px; perspective: 800px; } #formContainer table{ width:100%; height:100%; position:absolute; top:0; left:0; /* Enabling 3d space for the transforms */ -moz-transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; /* When the forms are flipped, they will be hidden */ -moz-backface-visibility: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; /* Enabling a smooth animated transition */ -moz-transition:0.666s; -webkit-transition:0.666s; transition:0.666s; } #login{ z-index:2; } #recover{ z-index:1; opacity:0; visibility: hidden; /* Rotating the recover password form by default */ -moz-transform:rotateX(180deg); -moz-transform:rotateX(180deg); -webkit-transform:rotateX(180deg); transform:rotateX(180deg); } #formContainer.flipped #login{ opacity:0; visibility:hidden; z-index:1; /** * Rotating the login form when the * flipped class is added to the container */ -moz-transform:rotateX(-180deg); -webkit-transform:rotateX(-180deg); transform:rotateX(-180deg); } #formContainer.flipped #recover{ opacity:1; z-index:2; visibility: visible; /* Rotating the recover div into view */ -moz-transform:rotateX(0deg); -webkit-transform:rotateX(0deg); transform:rotateX(0deg); } The following is the JS: $(function(){ $('.flipLink').click(function(e){ $('#formContainer').toggleClass('flipped'); $('.flash').hide('slow'); })}); And the following is the html code: div id=formContainer {{=login_form.custom.begin}} table id=login tr td colspan='2'{{=login_form.custom.widget.email}}/td /tr tr td colspan='2'{{=login_form.custom.widget.password}}/td /tr tr tda href=# id=flipToRecover class=flipLinkForgot Password?/a/td td{{=login_form.custom.submit}}/td /tr tr td colspan=2div class=error flash{{=response.flash}}/div/td /tr /table {{=login_form.custom.end}} {{=LOAD('user','request_reset_password.load',ajax=False,ajax_trap=True)}} /div On Wednesday, March 14, 2012 12:53:28 AM UTC+5:30, rochacbruno wrote: can you share your CSS/ Javascript code regarding the *flipLink and **flipToLogin objects? * On Tue, Mar 13, 2012 at 4:04 PM, Sushant Taneja sushant.tanej...@gmail.com wrote: Hi, In my view index.html, I have two forms: auth.login() and custom forgot password form. Initially the login form is displayed with a Forgot Password link. When we click on the link the form flips(rotates using CSS) and the forgot password form is now displayed. The forgot password form is a SQLFORM.factory generated form and is loaded in the page via the following line of code: {{=LOAD('user','request_reset_password.load',ajax=False,ajax_trap=True)}} The flip animation i.e. CSS rotation works fine until the forgot password form is submitted. After submission, the CSS breaksWARNING with import and threading.local(): they were hot topics on the pycon webdev summit, and other frameworks are facing problems with them. They could be memory hungry and contention problems could arise, so they could have scalabillity issues too. I think the web2py way is not so bad, but we should find some way to The .load component is as follows: {{=forgot_pass_form.custom.begin}} table id='recover' tr td colspan='2'Give us your email id and we will send you a link to reset your password/td /tr tr td colspan='2'{{=forgot_pass_form.custom.widget.email_id}}/td /tr tr td*a href=# id=flipToLogin class=flipLinkBack to Login/a*/td td{{=forgot_pass_form.custom.submit}}/td /tr tr td colspan='2' {{if forgot_pass_form.errors:}} div class=error{{=forgot_pass_form.errors.email_id}}/div {{pass}} /td /tr /table {{=forgot_pass_form.custom.end}} The bold code above is the link which causes the CSS rotation but after submission fails to do so Can somebody help me understand on what's happening ? Thanks, Sushant -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] Re: No models vs. conditional models -- what's the advantage?
Bruno: Sorry but I don't agree. We cannot solve the python threading problems (mostly caused by the GIL assumptions I think). It is simply out of the scope of the web2py project. So if you have a really big app and import everything, it will surely have an important memory footprint. It goes worse when you need several processes to archive greater concurrency, so you end having big startup times to load and import your app per each process, and a huge memory consumption. Consider a webhosting company, it could be a serious issue with multiple big apps like this. Threading.local only add more troubles to this mess, so you can't have async concurrency (async io loops is were I think we should go). Of course, this only happens to realy realy realy big apps, so most python and web2py users should not be concerned. I think that in that cases there are better solutions, like GAE. Namespaces are great and we use them, and we have a local/global context for each request that no other framework has, so we have an advantage here, not a disvantage IMHO BTW, I attended to the Graham Dumpleton talk about web server performance, where he explained that in the most cases, python is not the main problem you face, there are many other factors than can be optimized too. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Tue, Mar 13, 2012 at 12:20 PM, Bruno Rocha rochacbr...@gmail.com wrote: Mariano, if you are saying that importing anything and using current object inside the modules that we are importing is a problem, so I guess we really have a big problem! Many small apps can rely on some basic model execution system, but even if cached it would be still strange to have all of them loaded in cache. One of the most brilhant features of Python and any other modern language is the namespaces feature. So I can't imagine a big app without relying on namespaces, modules, packages, classes etc.. Thats the best way for programming in Python, and IMO: also thats the best way for programming in web2py. If threading.locals() has a problem,I think the goal should be to solve that problem, not to cache the models or to create routing hacks. (* I think map models is a good idea, but it is not a solution) Do you have any further information about that issue? On Tue, Mar 13, 2012 at 4:06 PM, Mariano Reingart reing...@gmail.com wrote: WARNING with import and threading.local(): they were hot topics on the pycon webdev summit, and other frameworks are facing problems with them. They could be memory hungry and contention problems could arise, so they could have scalabillity issues too. I think the web2py way is not so bad, but we should find some way to cache the models. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Reporting documentation/book typos?
What's the most efficient avenue to report documentation/book typos? Thx.
[web2py] Re: Time picker is not showing up on Appadmin page.
This is the time entry widget included with web2py (slightly modified): http://keith-wood.name/timeEntry.html. Note, when you click in the input field, there is no calendar popup. Instead, as soon as you start typing or hit an arrow key, you get a formatted time display, which you can then change via arrow keys, mouse wheel, or direct entry. Seems to be working when I test it with a field like the one you have defined below. Anthony On Monday, March 12, 2012 9:44:06 PM UTC-4, Kenny wrote: Date and datetime pickers are working fine except time picker Field('start_time', 'time',notnull=True), is what I put. It doesn't give me any js calendar popup. Any help? thank you.
[web2py] Re: logical/relationship url mapping
Thanks Anthony, Seems that experimental RESTful feature is exactly what I was looking for. The controller action approach got really ugly really fast, thus why I was looking for a more elegant approach :) On Monday, March 12, 2012 10:39:27 AM UTC-4, Anthony wrote: Check out the RESTful web services functionality: http://web2py.com/books/default/chapter/29/10#Restful-Web-Services, in particular, http://web2py.com/books/default/chapter/29/10#parse_as_rest-(experimental) . You could also handle this specific case in a controller action, with all the elements of your URL in request.args: In default.py: def TopThing(): rows = db((db.TopThing.id == db.MiddleThing.TopThing_id) (db.MiddleThing.id == db.BottomThing.MiddleThing_id) (db.TopThing.id == request.args(0)) (db.MiddleThing.id = request.args(2))).select() return dict(rows=rows) Anthony On Monday, March 12, 2012 10:05:31 AM UTC-4, rdodev wrote: Hello all, I'm fairly knew to web2py and trying to find things out by myself as much as I can. However, I have not been able to find how to create logical/relationship URLs. Let's say I have a model named TopThing, which has a 1-to-many relationship with MiddleThing, which also has a one-to-many relationship with BottomThing. (TopThing-1:*-MiddleThing-1:*-BottomThing). So we'd like navigation to follow that same idea of (/AppName/TopThing/{_Id}/MiddleThing/{_Id}/BottomThing). Is it possible to have this in web2py? If so, would some one care to explain? Thx.
Re: [web2py] Time picker is not showing up on Appadmin page.
On Tuesday, March 13, 2012 2:06:30 PM UTC-4, Richard wrote: I think you need to setup validator to have date time picker to show up. No, you don't need to set up a validator -- should work as long as the field type is time (that results in the input element getting class=time, which is the jQuery selector for attaching the timeEntry widget). Anthony
Re: [web2py] Re: No models vs. conditional models -- what's the advantage?
So let me understand better, Mariano, do you think that the use of modules to table-model definitions and using no-models scripts is a bad idea? -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] LOAD() function breaking CSS animation
On Tue, Mar 13, 2012 at 4:35 PM, Sushant Taneja sushant.tanej...@gmail.comwrote: $(function(){ $('.flipLink').click(function(e){ $('#formContainer').toggleClass('flipped'); $('.flash').hide('slow'); })}); The problem is that this JS is loaded before the ajax component, you have to bind the event using .live .bind or .on example: *$(document).on(click, .flipLink, function(event){ $('#formContainer').**toggleClass('flipped');** $('.flash').hide('slow');** });* -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: Reporting documentation/book typos?
Right here is good. Unfortunately, the new online book is not easily editable at the moment (except by Massimo), so corrections may take a while (once it's editable, someone will usually make the fix immediately). Anthony On Tuesday, March 13, 2012 3:54:56 PM UTC-4, rdodev wrote: What's the most efficient avenue to report documentation/book typos? Thx.
Re: [web2py] Re: Reporting documentation/book typos?
Thanks again, Anthony, I was just wondering if there was a system so that not to pollute the list with duplicate typos that have already been reported. On Tue, Mar 13, 2012 at 4:13 PM, Anthony abasta...@gmail.com wrote: Right here is good. Unfortunately, the new online book is not easily editable at the moment (except by Massimo), so corrections may take a while (once it's editable, someone will usually make the fix immediately). Anthony On Tuesday, March 13, 2012 3:54:56 PM UTC-4, rdodev wrote: What's the most efficient avenue to report documentation/book typos? Thx.
Re: [web2py] LOAD() function breaking CSS animation
Sorry, but I didn't get you. As per my understanding the component is loaded with option ajax=False, thus it will load with rest of the page. The script tag for inclusion of the JS file is just above the closing body tag (/body) and after the LOAD call. Also the flip works until the forgot password form is submitted. The problem occurs after forgot password form is submitted once. So essentially the JS file is already there, only the form is re-loading. Let me know if I am wrong somewhere. On Wednesday, March 14, 2012 1:34:21 AM UTC+5:30, rochacbruno wrote: On Tue, Mar 13, 2012 at 4:35 PM, Sushant Taneja sushant.tanej...@gmail.com wrote: $(function(){ $('.flipLink').click(function(e){ $('#formContainer').toggleClass('flipped'); $('.flash').hide('slow'); })}); The problem is that this JS is loaded before the ajax component, you have to bind the event using .live .bind or .on example: *$(document).on(click, .flipLink, function(event){ $('#formContainer').**toggleClass('flipped');** $('.flash').hide('slow');** });* -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: web2py talk at PyCon US 2012 [video]
Well there, Massimo is pretty good looking! ;) On Tuesday, March 13, 2012 1:22:39 PM UTC+8, rochacbruno wrote: http://pyvideo.org/video/714/web2py-ideas-we-stole-and-ideas-we-had -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] LOAD() function breaking CSS animation
Does this mean that I have to reload the JS again with the form as it is reloaded after submit ? On Wednesday, March 14, 2012 1:45:57 AM UTC+5:30, Sushant Taneja wrote: Sorry, but I didn't get you. As per my understanding the component is loaded with option ajax=False, thus it will load with rest of the page. The script tag for inclusion of the JS file is just above the closing body tag (/body) and after the LOAD call. Also the flip works until the forgot password form is submitted. The problem occurs after forgot password form is submitted once. So essentially the JS file is already there, only the form is re-loading. Let me know if I am wrong somewhere. On Wednesday, March 14, 2012 1:34:21 AM UTC+5:30, rochacbruno wrote: On Tue, Mar 13, 2012 at 4:35 PM, Sushant Taneja sushant.tanej...@gmail.com wrote: $(function(){ $('.flipLink').click(function(e){ $('#formContainer').toggleClass('flipped'); $('.flash').hide('slow'); })}); The problem is that this JS is loaded before the ajax component, you have to bind the event using .live .bind or .on example: *$(document).on(click, .flipLink, function(event){ $('#formContainer').**toggleClass('flipped');** $('.flash').hide('slow');** });* -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] Re: No models vs. conditional models -- what's the advantage?
I think that using modules to hold models is good only in some cases, so it is not something we should standarize/enforce/promote in general. We should search better ways to optimize web2py. IMHO Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Tue, Mar 13, 2012 at 1:00 PM, Bruno Rocha rochacbr...@gmail.com wrote: So let me understand better, Mariano, do you think that the use of modules to table-model definitions and using no-models scripts is a bad idea? -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] LOAD() function breaking CSS animation
Although the component (i.e., LOAD) is not initially an Ajax component, because you have ajax_trap=True, it becomes an Ajax component upon form submission (i.e., the form is submitted via Ajax, and the post-submission response is loaded into the component target via Ajax). Your click event handler is only set once when the page initially loads, so after a form submission, the new content of the component has no click handler attached. Instead, you should use the new jQuery.on() (which is recommended instead of .live() or .delegate() -- see http://api.jquery.com/on/) to attached the click event. Anthony On Tuesday, March 13, 2012 4:15:57 PM UTC-4, Sushant Taneja wrote: Sorry, but I didn't get you. As per my understanding the component is loaded with option ajax=False, thus it will load with rest of the page. The script tag for inclusion of the JS file is just above the closing body tag (/body) and after the LOAD call. Also the flip works until the forgot password form is submitted. The problem occurs after forgot password form is submitted once. So essentially the JS file is already there, only the form is re-loading. Let me know if I am wrong somewhere. On Wednesday, March 14, 2012 1:34:21 AM UTC+5:30, rochacbruno wrote: On Tue, Mar 13, 2012 at 4:35 PM, Sushant Taneja sushant.tanej...@gmail.com wrote: $(function(){ $('.flipLink').click(function(e){ $('#formContainer').toggleClass('flipped'); $('.flash').hide('slow'); })}); The problem is that this JS is loaded before the ajax component, you have to bind the event using .live .bind or .on example: *$(document).on(click, .flipLink, function(event){ $('#formContainer').**toggleClass('flipped');** $('.flash').hide('slow');** });* -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] LOAD() function breaking CSS animation
Does this mean that I have to reload the JS again with the form as it is reloaded after submit ? No -- see other replies. Just change how you attach the click event handler. Anthony
[web2py] Re: web2py talk at PyCon US 2012 [video]
Excellent presentation. Great job highlighting web2py's many strengths (in a fairly short time). Congratulations, Massimo (and everyone)! Anthony On Tuesday, March 13, 2012 1:22:39 AM UTC-4, rochacbruno wrote: http://pyvideo.org/video/714/web2py-ideas-we-stole-and-ideas-we-had -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] LOAD() function breaking CSS animation
Thanks to both Bruno and Anthony ! It is working now :) On Wednesday, March 14, 2012 2:05:42 AM UTC+5:30, Anthony wrote: Although the component (i.e., LOAD) is not initially an Ajax component, because you have ajax_trap=True, it becomes an Ajax component upon form submission (i.e., the form is submitted via Ajax, and the post-submission response is loaded into the component target via Ajax). Your click event handler is only set once when the page initially loads, so after a form submission, the new content of the component has no click handler attached. Instead, you should use the new jQuery.on() (which is recommended instead of .live() or .delegate() -- see http://api.jquery.com/on/) to attached the click event. Anthony On Tuesday, March 13, 2012 4:15:57 PM UTC-4, Sushant Taneja wrote: Sorry, but I didn't get you. As per my understanding the component is loaded with option ajax=False, thus it will load with rest of the page. The script tag for inclusion of the JS file is just above the closing body tag (/body) and after the LOAD call. Also the flip works until the forgot password form is submitted. The problem occurs after forgot password form is submitted once. So essentially the JS file is already there, only the form is re-loading. Let me know if I am wrong somewhere. On Wednesday, March 14, 2012 1:34:21 AM UTC+5:30, rochacbruno wrote: On Tue, Mar 13, 2012 at 4:35 PM, Sushant Taneja sushant.tanej...@gmail.com wrote: $(function(){ $('.flipLink').click(function(e){ $('#formContainer').toggleClass('flipped'); $('.flash').hide('slow'); })}); The problem is that this JS is loaded before the ajax component, you have to bind the event using .live .bind or .on example: *$(document).on(click, .flipLink, function(event){ $('#formContainer').**toggleClass('flipped');** $('.flash').hide('slow');** });* -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] Re: web2py talk at PyCon US 2012 [video]
Massimo, I want the tool you used to drive the presentation.. what is that magic? On Tue, Mar 13, 2012 at 5:38 PM, Anthony abasta...@gmail.com wrote: Excellent presentation. Great job highlighting web2py's many strengths (in a fairly short time). Congratulations, Massimo (and everyone)! Anthony On Tuesday, March 13, 2012 1:22:39 AM UTC-4, rochacbruno wrote: http://pyvideo.org/video/714/**web2py-ideas-we-stole-and-**ideas-we-hadhttp://pyvideo.org/video/714/web2py-ideas-we-stole-and-ideas-we-had -- Bruno Rocha [http://rochacbruno.com.br] -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] add a plugin to a created site?
Is there any way to add a plugin to a created site? I'm looking at the plugin_wiki and if I create a new site, I get to choose from several, (well, if I can see them). I have an app that I made, now I want to add the comments plugin to it. But plugins are not available anymore, only during the initial creation... so how would I add in the comments plugin to an already created site?
[web2py] Modules on Google App Engine
Hi all, I've added a new api.py file to the /modules directory. I've also added a call from my default.py from api import Api working locally, everything is fine. when deploying to GAE, I get type 'exceptions.ImportError' No module named api can anyone suggest an answer to my problem?
Re: [web2py] Modules on Google App Engine
Maybe you have a syntax error or an error with imports inside the api module, the web2py custom importer does not shows complete traceback for that cases. On Tue, Mar 13, 2012 at 10:48 AM, Udi Milo udim...@gmail.com wrote: Hi all, I've added a new api.py file to the /modules directory. I've also added a call from my default.py from api import Api working locally, everything is fine. when deploying to GAE, I get type 'exceptions.ImportError' No module named api can anyone suggest an answer to my problem? -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: who uses the online designer?
It's horribly out of date. SQLField isn't used anymore, and it won't make foreign keys when you are designing a web2py database. It's good for single table setups, but the code it produces is pretty useless. Sometimes the data types it tries to use are just wrong. I can't get saving to work no matter which browser I try, and 'list saved items' does nothing for me. Well, it does bring up an error this.dom.backend.value is null or not an object. On Thursday, February 11, 2010 11:13:38 AM UTC-7, snfctech wrote: It seems like some DAL types are left out - such as 'upload'. It's nice to have a visual DAL code generator, but if I have to go back and edit the generated code, then that seems to defeat the purpose a bit.
[web2py] Re: add a plugin to a created site?
There are plugins here (http://www.web2py.com/plugins) and here (http://dev.s-cubism.com/web2py_plugins), as well as a few others scattered about. To add a plugin to an existing application, just download the plugin .w2p file and either unzip it over your application's folder or use the plugin upload functionality in the admin interface (see example at bottom of this demo page: http://www.web2py.com/demo_admin/default/design/demo_app1). Anthony On Tuesday, March 13, 2012 5:16:56 PM UTC-4, Derek wrote: Is there any way to add a plugin to a created site? I'm looking at the plugin_wiki and if I create a new site, I get to choose from several, (well, if I can see them). I have an app that I made, now I want to add the comments plugin to it. But plugins are not available anymore, only during the initial creation... so how would I add in the comments plugin to an already created site?
[web2py] pycon talk
Massimo: can you make this url shortening app available? http://www.youtube.com/watch?v=M5IPlMe83yI thanks.
[web2py] Re: web2py recipe book
Is there a site with the table of contents??? would be nice to see the TOC.. thanks On Monday, 12 March 2012 00:18:43 UTC-7, Massimo Di Pierro wrote: The web2py recipes book is finally out: http://www.packtpub.com/web2py-application-development-recipes-to-master-python-web-framework-cookbook/book Congratulations to all those who contributed. Massimo
Re: [web2py] Re: No models vs. conditional models -- what's the advantage?
Regarding the GIL - IronPython has no GIL, and as of 2.7.1 has the CSV module, so the only thing that wouldn't work is the built-in webserver, and database drivers. You'd have to write the database access yourself. On Tuesday, March 13, 2012 12:46:31 PM UTC-7, Mariano Reingart wrote: Bruno: Sorry but I don't agree. We cannot solve the python threading problems (mostly caused by the GIL assumptions I think). It is simply out of the scope of the web2py project. So if you have a really big app and import everything, it will surely have an important memory footprint. It goes worse when you need several processes to archive greater concurrency, so you end having big startup times to load and import your app per each process, and a huge memory consumption. Consider a webhosting company, it could be a serious issue with multiple big apps like this. Threading.local only add more troubles to this mess, so you can't have async concurrency (async io loops is were I think we should go). Of course, this only happens to realy realy realy big apps, so most python and web2py users should not be concerned. I think that in that cases there are better solutions, like GAE. Namespaces are great and we use them, and we have a local/global context for each request that no other framework has, so we have an advantage here, not a disvantage IMHO BTW, I attended to the Graham Dumpleton talk about web server performance, where he explained that in the most cases, python is not the main problem you face, there are many other factors than can be optimized too. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Tue, Mar 13, 2012 at 12:20 PM, Bruno Rocha rochacbr...@gmail.com wrote: Mariano, if you are saying that importing anything and using current object inside the modules that we are importing is a problem, so I guess we really have a big problem! Many small apps can rely on some basic model execution system, but even if cached it would be still strange to have all of them loaded in cache. One of the most brilhant features of Python and any other modern language is the namespaces feature. So I can't imagine a big app without relying on namespaces, modules, packages, classes etc.. Thats the best way for programming in Python, and IMO: also thats the best way for programming in web2py. If threading.locals() has a problem,I think the goal should be to solve that problem, not to cache the models or to create routing hacks. (* I think map models is a good idea, but it is not a solution) Do you have any further information about that issue? On Tue, Mar 13, 2012 at 4:06 PM, Mariano Reingart reing...@gmail.com wrote: WARNING with import and threading.local(): they were hot topics on the pycon webdev summit, and other frameworks are facing problems with them. They could be memory hungry and contention problems could arise, so they could have scalabillity issues too. I think the web2py way is not so bad, but we should find some way to cache the models. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] error in def show():
Hii, I am getting an error at line 9: in creating an image blog in ubuntu(linux) 11.10 ,I have installed the web2py through terminal 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. def show(): image = db(db.image.id==request.args(0)).select().first() db.comment.image_id.default = image.id form = SQLFORM(db.comment) if form.process().accepted: response.flash = 'your comment is posted' comments = db(db.comment.image_id==image.id).select() return dict(image=image, comments=comments, form=form) return dict(image=image, comments=comments, form=form) I am not getting how to sort it out . and the script which I used in default.py is def index(): images = db().select(db.image.ALL, orderby=db.image.title) return dict(images=images) def show(): image = db(db.image.id==request http://127.0.0.1:8000/examples/global/vars/request.args(0)).select().first() db.comment.image_id.default = image.id form = SQLFORM http://127.0.0.1:8000/examples/global/vars/SQLFORM(db.comment) if form.process().accepted: response http://127.0.0.1:8000/examples/global/vars/response.flash = 'your comment is posted' comments = db(db.comment.image_id==image.id).select() return dict(image=image, comments=comments, form=form) def download(): return response http://127.0.0.1:8000/examples/global/vars/response.download(request http://127.0.0.1:8000/examples/global/vars/request, db) response http://127.0.0.1:8000/examples/global/vars/response._vars=response http://127.0.0.1:8000/examples/global/vars/response._caller(show)
[web2py] web2py ported to bottle, flask, pyramid, tornado, wsgiref
http://www.reddit.com/r/Python/comments/qv7zh/some_results_form_the_pycon_sprint/ Please help us test it
Re: [web2py] error in def show():
where is the traceback erro message? On Tue, Mar 13, 2012 at 7:18 PM, praveen krishna praveenchitne...@gmail.com wrote: Hii, I am getting an error at line 9: in creating an image blog in ubuntu(linux) 11.10 ,I have installed the web2py through terminal 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. def show(): image = db(db.image.id==request.args(0)).select().first() db.comment.image_id.default = image.id form = SQLFORM(db.comment) if form.process().accepted: response.flash = 'your comment is posted' comments = db(db.comment.image_id==image.id).select() return dict(image=image, comments=comments, form=form) return dict(image=image, comments=comments, form=form) I am not getting how to sort it out . and the script which I used in default.py is def index(): images = db().select(db.image.ALL, orderby=db.image.title) return dict(images=images) def show(): image = db(db.image.id==request http://127.0.0.1:8000/examples/global/vars/request.args(0)).select().first() db.comment.image_id.default = image.id form = SQLFORM http://127.0.0.1:8000/examples/global/vars/SQLFORM(db.comment) if form.process().accepted: response http://127.0.0.1:8000/examples/global/vars/response.flash = 'your comment is posted' comments = db(db.comment.image_id==image.id).select() return dict(image=image, comments=comments, form=form) def download(): return response http://127.0.0.1:8000/examples/global/vars/response.download(request http://127.0.0.1:8000/examples/global/vars/request, db) response http://127.0.0.1:8000/examples/global/vars/response._vars=response http://127.0.0.1:8000/examples/global/vars/response._caller(show) -- Bruno Rocha [http://rochacbruno.com.br]
Re: [web2py] web2py ported to bottle, flask, pyramid, tornado, wsgiref
Can i add this in pipy and add a setup.py? This is very usefull for me :) and others great job! This week i try to make my tiny version of web2py with werkzeug. 2012/3/13 Massimo Di Pierro massimo.dipie...@gmail.com: http://www.reddit.com/r/Python/comments/qv7zh/some_results_form_the_pycon_sprint/ Please help us test it -- Alvaro Lizama Molina - http://alvarolizama.net
Re: [web2py] error in def show():
Traceback (most recent call last): File /usr/lib/pymodules/python2.7/gluon/restricted.py, line 192, in restricted exec ccode in environment File /home/praveen/web2py/applications/my_images/controllers/default.py http://127.0.0.1:8000/admin/default/edit/my_images/controllers/default.py, line 17, in module File /usr/lib/pymodules/python2.7/gluon/globals.py, line 137, in lambda self._caller = lambda f: f() File /home/praveen/web2py/applications/my_images/controllers/default.py http://127.0.0.1:8000/admin/default/edit/my_images/controllers/default.py, line 9, in show if form.process().accepted: AttributeError: 'SQLFORM' object has no attribute 'process' i think this is the trace back msg On Tuesday, March 13, 2012 11:43:20 PM UTC+1, rochacbruno wrote: where is the traceback erro message? Hii, I am getting an error at line 9: in creating an image blog in ubuntu(linux) 11.10 ,I have installed the web2py through terminal 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. def show(): image = db(db.image.id==request.args(0)).select().first() db.comment.image_id.default = image.id form = SQLFORM(db.comment) if form.process().accepted: response.flash = 'your comment is posted' comments = db(db.comment.image_id==image.id).select() return dict(image=image, comments=comments, form=form) return dict(image=image, comments=comments, form=form) I am not getting how to sort it out . and the script which I used in default.py is def index(): images = db().select(db.image.ALL, orderby=db.image.title) return dict(images=images) def show(): image = db(db.image.id==request http://127.0.0.1:8000/examples/global/vars/request.args(0)).select().first() db.comment.image_id.default = image.id form = SQLFORM http://127.0.0.1:8000/examples/global/vars/SQLFORM(db.comment) if form.process().accepted: response http://127.0.0.1:8000/examples/global/vars/response.flash = 'your comment is posted' comments = db(db.comment.image_id==image.id).select() return dict(image=image, comments=comments, form=form) def download(): return response http://127.0.0.1:8000/examples/global/vars/response.download(request http://127.0.0.1:8000/examples/global/vars/request, db) response http://127.0.0.1:8000/examples/global/vars/response._vars=response http://127.0.0.1:8000/examples/global/vars/response._caller(show) -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: Picture Gallery
there is also an example (a bit dated) in web2py.com/appliances On Monday, 12 March 2012 04:36:07 UTC-5, Praveen Bhat wrote: Hello, Can someone give me a simple example for Photo Gallery with Sliding content? Thanks in advance!!! Regards Praveen
[web2py] Re: Web2py cookbook
I was told it is available but I do not know more than you. We finished it one week ago. On Monday, 12 March 2012 05:27:44 UTC-5, bussiere adrien wrote: Does anyone know when the web2py cookbook will be available please ? Regards Bussiere Les nouvelles technologies offrent pleins de nouvelles possibilités, pleins de possibilités d'erreurs surtout en fait. insurance.aes256 : http://goo.gl/gHyAY
[web2py] Installing web2py source libraries, etc.
Hi, I'm trying to install the web2py source code so I can import the modules from any Python program. But I'm having trouble. The setup.py for web2py itself seems to require imports from web2py modules. I'm not sure how to install the libraries so they appear on my Python path. Thanks for any help.
[web2py] Re: web2py talk at PyCon US 2012 [video]
On Tuesday, 13 March 2012 00:22:39 UTC-5, rochacbruno wrote: http://pyvideo.org/video/714/web2py-ideas-we-stole-and-ideas-we-had -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: pycon talk
https://github.com/mdipierro/web2py-appliances/tree/master/UrlShortening On Tuesday, 13 March 2012 17:04:09 UTC-5, VP wrote: Massimo: can you make this url shortening app available? http://www.youtube.com/watch?v=M5IPlMe83yI thanks.
[web2py] Re: Installing web2py source libraries, etc.
gluon is the main library of web2py (and what you are more likely to import from another python app). for the script to have access to the gluon library/package you should start the script from the web2py source folder In a linux console: (with superuser rights) cd web2py folder ./setup.py On Mar 13, 8:18 pm, David Wong davidwong...@hotmail.com wrote: Hi, I'm trying to install the web2py source code so I can import the modules from any Python program. But I'm having trouble. The setup.py for web2py itself seems to require imports from web2py modules. I'm not sure how to install the libraries so they appear on my Python path. Thanks for any help.
Re: [web2py] Re: Installing web2py source libraries, etc.
web2py should distribute like a python module too, via pypi this repo is old. 2012/3/13 Alan Etkin spame...@gmail.com: gluon is the main library of web2py (and what you are more likely to import from another python app). for the script to have access to the gluon library/package you should start the script from the web2py source folder In a linux console: (with superuser rights) cd web2py folder ./setup.py On Mar 13, 8:18 pm, David Wong davidwong...@hotmail.com wrote: Hi, I'm trying to install the web2py source code so I can import the modules from any Python program. But I'm having trouble. The setup.py for web2py itself seems to require imports from web2py modules. I'm not sure how to install the libraries so they appear on my Python path. Thanks for any help. -- Alvaro Lizama Molina - http://alvarolizama.net
[web2py] Re: pycon talk
Thank you. Bookmark = db.define_table( 'bookmark', Field('link','reference link',writable=False), Field('category',requires=IS_IN_SET(['work','personal'])), Field('tags','list:string'), auth.signature) Can you explain what auth.signature? This feature doesn't seem documented. Thanks. On Mar 13, 6:41 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: https://github.com/mdipierro/web2py-appliances/tree/master/UrlShortening On Tuesday, 13 March 2012 17:04:09 UTC-5, VP wrote: Massimo: can you make this url shortening app available? http://www.youtube.com/watch?v=M5IPlMe83yI thanks.
[web2py] install web2py in dreamhost
Hi, Have anyone installed web2py in dreamhost or have a tutorial similar to do it? Thanks Alex
[web2py] Re: web2py ported to bottle, flask, pyramid, tornado, wsgiref
Nice. On Github, change the description from: Port of web2py to other Bottle, Flask, Pyramid, Tornado and other frameworks to: Port of web2py to Bottle, Flask, Pyramid, Tornado and other frameworks On Tuesday, March 13, 2012 6:27:34 PM UTC-4, Massimo Di Pierro wrote: http://www.reddit.com/r/Python/comments/qv7zh/some_results_form_the_pycon_sprint/ Please help us test it
[web2py] Re: pycon talk
Bookmark = db.define_table( 'bookmark', Field('link','reference link',writable=False), Field('category',requires=IS_IN_SET(['work','personal'])), Field('tags','list:string'), auth.signature) Can you explain what auth.signature? This feature doesn't seem documented. It's mentioned briefly here: http://web2py.com/books/default/chapter/29/6#Table-inheritance. Anthony
[web2py] Re: error in def show():
You seem to be running an old web2py. Perhaps you have a conflicting version of the gluon libraries? On Tuesday, 13 March 2012 17:18:35 UTC-5, praveen krishna wrote: Hii, I am getting an error at line 9: in creating an image blog in ubuntu(linux) 11.10 ,I have installed the web2py through terminal 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. def show(): image = db(db.image.id==request.args(0)).select().first() db.comment.image_id.default = image.id form = SQLFORM(db.comment) if form.process().accepted: response.flash = 'your comment is posted' comments = db(db.comment.image_id==image.id).select() return dict(image=image, comments=comments, form=form) return dict(image=image, comments=comments, form=form) I am not getting how to sort it out . and the script which I used in default.py is def index(): images = db().select(db.image.ALL, orderby=db.image.title) return dict(images=images) def show(): image = db(db.image.id==request http://127.0.0.1:8000/examples/global/vars/request.args(0)).select().first() db.comment.image_id.default = image.id form = SQLFORM http://127.0.0.1:8000/examples/global/vars/SQLFORM(db.comment) if form.process().accepted: response http://127.0.0.1:8000/examples/global/vars/response.flash = 'your comment is posted' comments = db(db.comment.image_id==image.id).select() return dict(image=image, comments=comments, form=form) def download(): return response http://127.0.0.1:8000/examples/global/vars/response.download(request http://127.0.0.1:8000/examples/global/vars/request, db) response http://127.0.0.1:8000/examples/global/vars/response._vars=response http://127.0.0.1:8000/examples/global/vars/response._caller(show)
[web2py] Re: pycon talk
Also, I saw in the video the field tag of type list:string is presented nicely in view in the following way: after a new tag is entered, a new empty textbox is added so a new tag can be added. How is this done? (I don't think this is the default behavior).
[web2py] Re: web2py recipe book
Hope this stimulates much interest in the cookbook and that I'm not stepping on any copyright issues. This is the pre-production TOC. web2py Cookbook Table of Contents (draft copy) Chapter 1: Deploying web2py - Installing web2py on Windows (from source code) - Installing web2py on Ubuntu - Setting up a production deployment on Ubuntu - Running web2py with Apache, mod_proxy, and mod_rewrite - Running web2py with Lighttpd - Running web2py with Cherokee - Running web2py with Nginx and uWSGI - Running web2py on shared hosts using CGI - Running web2py on shared hosts with mod_proxy - Running web2py from a user-defined folder - Installing web2py as a service in Ubuntu - Running web2py with IIS as proxy - Running web2py with ISAPI Chapter 2: Building Your First Application - Improving the scaffolding application - Building a simple contacts application - Building a Reddit clone - Building a Facebook clone - Using crud.archive - Converting an existing static site into a web2py application - Creating semi-static pages (flatpages) - Adding your custom logo - Creating menus and submenus - Customizing menus with icons - Creating a navigation bar - Using cookies to set the language - Designing modular applications - Speeding up downloads Chapter 3: Database Abstraction Layer - Creating a new model - Creating a model from a csv file - Batch upload of your data - Moving your data from one database to another - Creating a model from existing MySQL and PostgreSQL databases - Efficiently searching by tag - Accessing your database from multiple applications - Hierarchical category tree - Creating records on demand - OR, LIKE, BELONGS, and more on Google App Engine - Replacing slow virtual fields with DB views Chapter 4: Advanced Forms - Adding a cancel button to forms - Adding confirmation on form submit - Searching data dynamically - Embedding multiple forms in one page - Detecting and blocking concurrent updates - Creating a form wizard - De-normalizing data temporarily - Removing form labels - Using fileuploader.js - Uploading files using a LOADed component - Making image thumbnails from uploaded images - Monitoring upload progress - Auto tooltip in forms - Color picker widget - Shortening text fields - Creating multi-table forms - Creating a multi-table form with references - Creating a multi-table update form - Star rating widget Chapter 5: Adding Ajax Effects - Using jquery.multiselect.js - Creating a select_or_add widget - Using an autocompletion plugin - Creating a drop-down date selector - Improving the built-in ajax function - Using a slider to represent a number - Using jqGrid and web2py - Improving data tables with WebGrid - Ajaxing your search functions - Creating sparklines Chapter 6: Using Third-party Libraries - Customizing logging - Aggregating feeds - Displaying Tweets - Plotting with matplotlib - Extending PluginWiki with an RSS widget Chapter 7: Web Services - Consuming a web2py JSON service with jQuery - Consuming a JSON-RPC service - JSON-RPC from JavaScript - Making amf3 RPC calls from Flex using pyamf - PayPal integration in web2py - PayPal web payments standard - Getting Flickr photos - Sending e-mails with Boto through Amazon Web Services (AWS) - Making GIS maps using mapscript - Google groups and Google code feeds reader - Creating SOAP web services Chapter 8: Authentication and Authorization - Customizing Auth - Using CAPTCHA un login failure - Using pyGravatar to get avatars for user profile pages - Multi-user and teacher modes - Authenticating with Facebook using OAuth 2.0 Chapter 9: Routing Routing Routing Routing Recipes ecipesecipes In this chapter, we will cover the following recipes: - Making cleaner URLs with routes.py - Creating a simple router - Adding a URL prefix - Associating applications with domains - Omitting the application name - Removing application name and controllers from URLs - Replacing underscores with hyphens in URLs - Mapping favicons.ico and robots.txt - Using URL to specify the language Chapter 10: Reporting Recipes - Creating PDF reports - Creating PDF listings - Creating PDF labels, badges, and invoices Chapter 11: Other Tips and Tricks - Using PDB and the embedded web2py debugger - Debugging with Eclipse and PyDev - Updating web2py using a shell script - Creating a simple page statistics plugin - Rounding corners without images or JavaScript - Setting a cache.disk quota - Checking if web2py is running using cron - Building a Mercurial plugin - Building a pingback plugin - Changing views for mobile browsers - Background processing with a database queue - How to effectively use template blocks - Making standalone applications with web2py and wxPython
[web2py] Re: web2py ported to bottle, flask, pyramid, tornado, wsgiref
I think you are looking at the old repo. I deleted it. The new one is this one: https://github.com/mdipierro/gluino On Tuesday, 13 March 2012 19:40:20 UTC-5, Anthony wrote: Nice. On Github, change the description from: Port of web2py to other Bottle, Flask, Pyramid, Tornado and other frameworks to: Port of web2py to Bottle, Flask, Pyramid, Tornado and other frameworks On Tuesday, March 13, 2012 6:27:34 PM UTC-4, Massimo Di Pierro wrote: http://www.reddit.com/r/Python/comments/qv7zh/some_results_form_the_pycon_sprint/ Please help us test it
[web2py] Re: web2py ported to bottle, flask, pyramid, tornado, wsgiref
No, that's the one I'm looking at -- the one-line description says: Port of web2py to other Bottle, Flask, Pyramid, Tornado and other frameworks Delete the other before Bottle. Anthony On Tuesday, March 13, 2012 9:18:11 PM UTC-4, Massimo Di Pierro wrote: I think you are looking at the old repo. I deleted it. The new one is this one: https://github.com/mdipierro/gluino On Tuesday, 13 March 2012 19:40:20 UTC-5, Anthony wrote: Nice. On Github, change the description from: Port of web2py to other Bottle, Flask, Pyramid, Tornado and other frameworks to: Port of web2py to Bottle, Flask, Pyramid, Tornado and other frameworks On Tuesday, March 13, 2012 6:27:34 PM UTC-4, Massimo Di Pierro wrote: http://www.reddit.com/r/Python/comments/qv7zh/some_results_form_the_pycon_sprint/ Please help us test it
[web2py] Re: pycon talk
On Tuesday, March 13, 2012 9:17:06 PM UTC-4, VP wrote: Also, I saw in the video the field tag of type list:string is presented nicely in view in the following way: after a new tag is entered, a new empty textbox is added so a new tag can be added. How is this done? (I don't think this is the default behavior). In SQLFORM, the list widget is assigned to list: type fields: http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#873 And the list widget includes Javascript to handle the inputs: http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#234. Anthony
Re: [web2py] install web2py in dreamhost
Isn't dreamhost and hostmonster the same? If they are I have my site running on hostmonster and can show you. On Tue, Mar 13, 2012 at 5:27 PM, Alex s alexsalga...@gmail.com wrote: Hi, Have anyone installed web2py in dreamhost or have a tutorial similar to do it? Thanks Alex -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com
Re: [web2py] install web2py in dreamhost
.htaccess: Options +SymLinksIfOwnerMatch AddHandler fcgid-script .fcgi # Do not change this line. RewriteEngine on RewriteCond %{HTTP_HOST} ^www.website.com$ # Change 'subfolder' to be the folder you will use for your main domain. RewriteCond %{REQUEST_URI} !^/web2py.fcgi/ # Don't change this line. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Change 'subfolder' to be the folder you will use for your main domain. RewriteRule ^(.*)$ /web2py.fcgi/$1 RewriteCond %{HTTP_HOST} ^(www.)?website.com$ RewriteCond %{HTTP_HOST} !^www.website.com$ RewriteRule ^(.*)$ http://www.website.com/$1 [R=301] RewriteRule ^(/)?$ web2py.fcgi/ [L] web2py.fcgi: #!/home1/path_to_virtual_env/web2py_dev/bin/python import sys from flup.server.fcgi_fork import WSGIServer import gluon.main application=gluon.main.wsgibase WSGIServer(application).run() On Tue, Mar 13, 2012 at 6:36 PM, Bruce Wade bruce.w...@gmail.com wrote: Isn't dreamhost and hostmonster the same? If they are I have my site running on hostmonster and can show you. On Tue, Mar 13, 2012 at 5:27 PM, Alex s alexsalga...@gmail.com wrote: Hi, Have anyone installed web2py in dreamhost or have a tutorial similar to do it? Thanks Alex -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com
Re: [web2py] install web2py in dreamhost
Hi Bruce, I don´t know if its the same, but could you show me about your pass-by-pass installation process ? Thanks Alex On Tue, Mar 13, 2012 at 10:36 PM, Bruce Wade bruce.w...@gmail.com wrote: Isn't dreamhost and hostmonster the same? If they are I have my site running on hostmonster and can show you. On Tue, Mar 13, 2012 at 5:27 PM, Alex s alexsalga...@gmail.com wrote: Hi, Have anyone installed web2py in dreamhost or have a tutorial similar to do it? Thanks Alex -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com
Re: [web2py] install web2py in dreamhost
Copy the .htaccess from my last message, change website.com to whatever your website is. Create web2py.fcgi copy the contents in that file from the last email. Make sure to make that file executable. chmod +x web2py.fcgi On Tue, Mar 13, 2012 at 6:42 PM, Alex s alexsalga...@gmail.com wrote: Hi Bruce, I don´t know if its the same, but could you show me about your pass-by-pass installation process ? Thanks Alex On Tue, Mar 13, 2012 at 10:36 PM, Bruce Wade bruce.w...@gmail.com wrote: Isn't dreamhost and hostmonster the same? If they are I have my site running on hostmonster and can show you. On Tue, Mar 13, 2012 at 5:27 PM, Alex s alexsalga...@gmail.com wrote: Hi, Have anyone installed web2py in dreamhost or have a tutorial similar to do it? Thanks Alex -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com
Re: [web2py] install web2py in dreamhost
http://www.web2pyslices.com/slice/show/1401/web2py-on-shared-hosting-hostmonster-with-fastcgi On Tue, Mar 13, 2012 at 6:44 PM, Bruce Wade bruce.w...@gmail.com wrote: Copy the .htaccess from my last message, change website.com to whatever your website is. Create web2py.fcgi copy the contents in that file from the last email. Make sure to make that file executable. chmod +x web2py.fcgi On Tue, Mar 13, 2012 at 6:42 PM, Alex s alexsalga...@gmail.com wrote: Hi Bruce, I don´t know if its the same, but could you show me about your pass-by-pass installation process ? Thanks Alex On Tue, Mar 13, 2012 at 10:36 PM, Bruce Wade bruce.w...@gmail.comwrote: Isn't dreamhost and hostmonster the same? If they are I have my site running on hostmonster and can show you. On Tue, Mar 13, 2012 at 5:27 PM, Alex s alexsalga...@gmail.com wrote: Hi, Have anyone installed web2py in dreamhost or have a tutorial similar to do it? Thanks Alex -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com
Re: [web2py] install web2py in dreamhost
Thank you Bruce, I will try it on dreamhost.com shared server. Thanks Alex On Tue, Mar 13, 2012 at 10:46 PM, Bruce Wade bruce.w...@gmail.com wrote: http://www.web2pyslices.com/slice/show/1401/web2py-on-shared-hosting-hostmonster-with-fastcgi On Tue, Mar 13, 2012 at 6:44 PM, Bruce Wade bruce.w...@gmail.com wrote: Copy the .htaccess from my last message, change website.com to whatever your website is. Create web2py.fcgi copy the contents in that file from the last email. Make sure to make that file executable. chmod +x web2py.fcgi On Tue, Mar 13, 2012 at 6:42 PM, Alex s alexsalga...@gmail.com wrote: Hi Bruce, I don´t know if its the same, but could you show me about your pass-by-pass installation process ? Thanks Alex On Tue, Mar 13, 2012 at 10:36 PM, Bruce Wade bruce.w...@gmail.comwrote: Isn't dreamhost and hostmonster the same? If they are I have my site running on hostmonster and can show you. On Tue, Mar 13, 2012 at 5:27 PM, Alex s alexsalga...@gmail.com wrote: Hi, Have anyone installed web2py in dreamhost or have a tutorial similar to do it? Thanks Alex -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com
Re: [web2py] install web2py in dreamhost
Yeah it should be similar. On Tue, Mar 13, 2012 at 6:48 PM, Alex s alexsalga...@gmail.com wrote: Thank you Bruce, I will try it on dreamhost.com shared server. Thanks Alex On Tue, Mar 13, 2012 at 10:46 PM, Bruce Wade bruce.w...@gmail.com wrote: http://www.web2pyslices.com/slice/show/1401/web2py-on-shared-hosting-hostmonster-with-fastcgi On Tue, Mar 13, 2012 at 6:44 PM, Bruce Wade bruce.w...@gmail.com wrote: Copy the .htaccess from my last message, change website.com to whatever your website is. Create web2py.fcgi copy the contents in that file from the last email. Make sure to make that file executable. chmod +x web2py.fcgi On Tue, Mar 13, 2012 at 6:42 PM, Alex s alexsalga...@gmail.com wrote: Hi Bruce, I don´t know if its the same, but could you show me about your pass-by-pass installation process ? Thanks Alex On Tue, Mar 13, 2012 at 10:36 PM, Bruce Wade bruce.w...@gmail.comwrote: Isn't dreamhost and hostmonster the same? If they are I have my site running on hostmonster and can show you. On Tue, Mar 13, 2012 at 5:27 PM, Alex s alexsalga...@gmail.comwrote: Hi, Have anyone installed web2py in dreamhost or have a tutorial similar to do it? Thanks Alex -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com
[web2py] Re: pycon talk
Anthony, maybe I didn't ask clearly. Here's the model: Bookmark = db.define_table( 'bookmark', Field('link','reference link',writable=False), Field('category',requires=IS_IN_SET(['work','personal'])), Field('tags','list:string'), auth.signature) I'm talking about field tags Here's view: {{extend 'layout.html'}} h3Bookmark for {{=url}}/h3 {{def show(rating,k):}}strong{{=rating.get(k,[0])[0]}}%/ strong{{return}} div Trustworthiness: {{show(rating,'1')}} Reliability: {{show(rating,'2')}} Privacy: {{show(rating,'3')}} Child safety: {{show(rating,'4')}} /div img src={{=URL('default','download',args=link.screenshot)}} align=right/ {{=form}} I don't see anything special in view, but the field tags automatically adds a new text box for a new tag, after you enter a tag. How do I do this? This behavior isn't by default (I think). Thanks. On Mar 13, 8:26 pm, Anthony abasta...@gmail.com wrote: On Tuesday, March 13, 2012 9:17:06 PM UTC-4, VP wrote: Also, I saw in the video the field tag of type list:string is presented nicely in view in the following way: after a new tag is entered, a new empty textbox is added so a new tag can be added. How is this done? (I don't think this is the default behavior). In SQLFORM, the list widget is assigned to list: type fields:http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#873 And the list widget includes Javascript to handle the inputs:http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#234. Anthony
[web2py] Re: SQLForm
Sharp eyes there, Anthony :D On Tuesday, March 13, 2012 11:31:43 PM UTC+8, Anthony wrote: Show your code. Note, it is writable, not writeable. Anthony On Tuesday, March 13, 2012 9:15:34 AM UTC-4, Brian F wrote: I have a table with a user id, an item id, and a permission level. I am trying to generate a form using SQLForm to change the permission level. The problem is I still want the user id and the item id to show up, but I don't want them to be editable. I would have thought setting writeable to false would have accomplished that, but the field still showed up as editable. How would I go about doing this?
[web2py] Re: pycon talk
As long as the form is a SQLFORM (including Crud and SQLFORM.grid), then yes, that should be the default behavior simply by specifying a list:string type field. SQLFORM automatically uses the SQLFORM.widgets.list widget for list:string and list:integer fields, and that widget includes the Javascript to implement the behavior. If you view the page source in your browser, you should see the Javascript code inserted right after the UL. Anthony On Tuesday, March 13, 2012 10:32:14 PM UTC-4, VP wrote: Anthony, maybe I didn't ask clearly. Here's the model: Bookmark = db.define_table( 'bookmark', Field('link','reference link',writable=False), Field('category',requires=IS_IN_SET(['work','personal'])), Field('tags','list:string'), auth.signature) I'm talking about field tags Here's view: {{extend 'layout.html'}} h3Bookmark for {{=url}}/h3 {{def show(rating,k):}}strong{{=rating.get(k,[0])[0]}}%/ strong{{return}} div Trustworthiness: {{show(rating,'1')}} Reliability: {{show(rating,'2')}} Privacy: {{show(rating,'3')}} Child safety: {{show(rating,'4')}} /div img src={{=URL('default','download',args=link.screenshot)}} align=right/ {{=form}} I don't see anything special in view, but the field tags automatically adds a new text box for a new tag, after you enter a tag. How do I do this? This behavior isn't by default (I think). Thanks. On Mar 13, 8:26 pm, Anthony abasta...@gmail.com wrote: On Tuesday, March 13, 2012 9:17:06 PM UTC-4, VP wrote: Also, I saw in the video the field tag of type list:string is presented nicely in view in the following way: after a new tag is entered, a new empty textbox is added so a new tag can be added. How is this done? (I don't think this is the default behavior). In SQLFORM, the list widget is assigned to list: type fields: http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#873 And the list widget includes Javascript to handle the inputs: http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#234. Anthony
[web2py] Re: pycon talk
That's strange. I'm using the latest web2py and I do not have this as default behavior. On Mar 13, 9:47 pm, Anthony abasta...@gmail.com wrote: As long as the form is a SQLFORM (including Crud and SQLFORM.grid), then yes, that should be the default behavior simply by specifying a list:string type field. SQLFORM automatically uses the SQLFORM.widgets.list widget for list:string and list:integer fields, and that widget includes the Javascript to implement the behavior. If you view the page source in your browser, you should see the Javascript code inserted right after the UL. Anthony On Tuesday, March 13, 2012 10:32:14 PM UTC-4, VP wrote: Anthony, maybe I didn't ask clearly. Here's the model: Bookmark = db.define_table( 'bookmark', Field('link','reference link',writable=False), Field('category',requires=IS_IN_SET(['work','personal'])), Field('tags','list:string'), auth.signature) I'm talking about field tags Here's view: {{extend 'layout.html'}} h3Bookmark for {{=url}}/h3 {{def show(rating,k):}}strong{{=rating.get(k,[0])[0]}}%/ strong{{return}} div Trustworthiness: {{show(rating,'1')}} Reliability: {{show(rating,'2')}} Privacy: {{show(rating,'3')}} Child safety: {{show(rating,'4')}} /div img src={{=URL('default','download',args=link.screenshot)}} align=right/ {{=form}} I don't see anything special in view, but the field tags automatically adds a new text box for a new tag, after you enter a tag. How do I do this? This behavior isn't by default (I think). Thanks. On Mar 13, 8:26 pm, Anthony abasta...@gmail.com wrote: On Tuesday, March 13, 2012 9:17:06 PM UTC-4, VP wrote: Also, I saw in the video the field tag of type list:string is presented nicely in view in the following way: after a new tag is entered, a new empty textbox is added so a new tag can be added. How is this done? (I don't think this is the default behavior). In SQLFORM, the list widget is assigned to list: type fields: http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#873 And the list widget includes Javascript to handle the inputs: http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#234. Anthony
[web2py] Re: web2py ported to bottle, flask, pyramid, tornado, wsgiref
I found it. And I fixed it now. Thanks for reporting it. On Tuesday, 13 March 2012 20:20:02 UTC-5, Anthony wrote: No, that's the one I'm looking at -- the one-line description says: Port of web2py to other Bottle, Flask, Pyramid, Tornado and other frameworks Delete the other before Bottle. Anthony On Tuesday, March 13, 2012 9:18:11 PM UTC-4, Massimo Di Pierro wrote: I think you are looking at the old repo. I deleted it. The new one is this one: https://github.com/mdipierro/gluino On Tuesday, 13 March 2012 19:40:20 UTC-5, Anthony wrote: Nice. On Github, change the description from: Port of web2py to other Bottle, Flask, Pyramid, Tornado and other frameworks to: Port of web2py to Bottle, Flask, Pyramid, Tornado and other frameworks On Tuesday, March 13, 2012 6:27:34 PM UTC-4, Massimo Di Pierro wrote: http://www.reddit.com/r/Python/comments/qv7zh/some_results_form_the_pycon_sprint/ Please help us test it
Re: [web2py] Re: web2py ported to bottle, flask, pyramid, tornado, wsgiref
Amazing! just installed using easy_install on windows! *c:\Python27\Scriptseasy_install.exe gluino* Searching for gluino Reading http://pypi.python.org/simple/gluino/ Reading https://github.com/mdipierro/gluino Best match: Gluino 0.1 Downloading http://pypi.python.org/packages/source/G/Gluino/Gluino-0.1.tar.gz#md 5= 89d645322f6a0af56f80ba8df6f84e34 Processing Gluino-0.1.tar.gz Running Gluino-0.1\setup.py -q bdist_egg --dist-dir c:\users\rochac~1\appdata\lo cal\temp\easy_install-qcludi\Gluino-0.1\egg-dist-tmp-m_pspc zip_safe flag not set; analyzing archive contents... gluino.custom_import: module references __file__ Adding gluino 0.1 to easy-install.pth file Installed c:\python27\lib\site-packages\gluino-0.1-py2.7.egg Processing dependencies for gluino Finished processing dependencies for gluino c:\Python27\Scriptspython Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win 32 Type help, copyright, credits or license for more information. * from gluino import ** No handlers could be found for logger web2py