Re: [web2py] Trying to run web2py from linux, all ports fail
*TIME_WAIT** is the state that typically ties up the port for several minutes after the process has completed.*The length of the associated timeout varies on different operating systems, and may be dynamic on some operating systems, however typical values are in the range of one to four minutes. HTH Le 30 janv. 2015 05:16, Aydin S hsofl...@gmail.com a écrit : Hi, I'm trying to run web2py from linux. However, it fails with this error: ERROR:Rocket.Errors.Port8000:Socket hostname:8000 in use by other process and it won't share. WARNING:Rocket.Errors.Port8000:Listener started when not ready. I have tried various ports like 8001, and it fails still. There is no other process using these ports. By the way, this does not happen in windows. I searched in the group for this problem and saw some posts but no help from those. Any help or advice is appreciated. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Credit card payment for european web site
Hi, try http://www.worldpay.com/global, it has a nice api. -Mirko On Monday, October 27, 2014 9:52:16 AM UTC+1, Gael Princivalle wrote: Hello. I'm still checking how to do an ecommerce website with web2py. As the website will be Italian, I've to check how making payments. Stripe.com, Authorize.net, and DowCommerce seems to be dedicated to US customers. With Google Wallet all products have to registrated inside the Google Wallet system (as for the Paypal Express Checkout). So it seems that the only way to manage payments without single products registration is the Paypal Standard integration. Someone can confirm me that ? I've found that, but it's from 2009. http://www.web2pyslices.com/slice/show/1336/paypal-integration-in-web2py Do we have some more documentation about Paypal integration ? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Credit card payment for european web site
No, but I did it in Plone quite smoothly a long time ago. On Monday, October 27, 2014 10:16:52 AM UTC+1, Gael Princivalle wrote: Hi Mirko. Have you already integrate worldplay inside web2py ? -- Gael Princivalle 2014-10-27 10:01 GMT+01:00 Mirko mscav...@gmail.com javascript:: Hi, try http://www.worldpay.com/global, it has a nice api. -Mirko On Monday, October 27, 2014 9:52:16 AM UTC+1, Gael Princivalle wrote: Hello. I'm still checking how to do an ecommerce website with web2py. As the website will be Italian, I've to check how making payments. Stripe.com, Authorize.net, and DowCommerce seems to be dedicated to US customers. With Google Wallet all products have to registrated inside the Google Wallet system (as for the Paypal Express Checkout). So it seems that the only way to manage payments without single products registration is the Paypal Standard integration. Someone can confirm me that ? I've found that, but it's from 2009. http://www.web2pyslices.com/slice/show/1336/paypal-integration-in-web2py Do we have some more documentation about Paypal integration ? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/iCMAuvvYsrg/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: float field search and grid/smartgrid
Have this issue also with Linux(Ubuntu). On Saturday, October 18, 2014 8:17:59 PM UTC+2, Mirko wrote: Up... Anybody else had this issue ? Thanks, -Mirko On Friday, October 17, 2014 8:44:41 AM UTC+2, Mirko wrote: Hi all, maybe I should elaborate a little bit more: here's my model: db.define_table('myTable', Field('myDate','datetime'), Field('myString','string'), Field('myFloat','float'), ) here's my controller: def index(): grid = SQLFORM.smartgrid(db.myTable) return locals() and here's what I get: https://lh4.googleusercontent.com/-CPjxo21rh2U/VEC6M40E8QI/Ftk/JiW3ZBbFcUg/s1600/w2pFloatBug.png Float field is not in the dropdown list, any ideas ? I'm using web2py Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 on windows platform (downloaded 2 days ago from web2py website). Thanks for helping, -Mirko On Thursday, October 16, 2014 5:03:12 PM UTC+2, Mirko wrote: Sorry, is the float search implemented in grid and smartgrid? I have a table with date, string and float fields and float fields are not searchable. Thanks, -Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: float field search and grid/smartgrid
Found it, 'float' is not a field type, I should have used 'double'. Nevertheless 'float' is accepted as field type in table definitions (shouldn't be) and is not displayed in search forms. hth -Mirko On Monday, October 20, 2014 3:21:21 PM UTC+2, Mirko wrote: Have this issue also with Linux(Ubuntu). On Saturday, October 18, 2014 8:17:59 PM UTC+2, Mirko wrote: Up... Anybody else had this issue ? Thanks, -Mirko On Friday, October 17, 2014 8:44:41 AM UTC+2, Mirko wrote: Hi all, maybe I should elaborate a little bit more: here's my model: db.define_table('myTable', Field('myDate','datetime'), Field('myString','string'), Field('myFloat','float'), ) here's my controller: def index(): grid = SQLFORM.smartgrid(db.myTable) return locals() and here's what I get: https://lh4.googleusercontent.com/-CPjxo21rh2U/VEC6M40E8QI/Ftk/JiW3ZBbFcUg/s1600/w2pFloatBug.png Float field is not in the dropdown list, any ideas ? I'm using web2py Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 on windows platform (downloaded 2 days ago from web2py website). Thanks for helping, -Mirko On Thursday, October 16, 2014 5:03:12 PM UTC+2, Mirko wrote: Sorry, is the float search implemented in grid and smartgrid? I have a table with date, string and float fields and float fields are not searchable. Thanks, -Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: float field search and grid/smartgrid
Up... Anybody else had this issue ? Thanks, -Mirko On Friday, October 17, 2014 8:44:41 AM UTC+2, Mirko wrote: Hi all, maybe I should elaborate a little bit more: here's my model: db.define_table('myTable', Field('myDate','datetime'), Field('myString','string'), Field('myFloat','float'), ) here's my controller: def index(): grid = SQLFORM.smartgrid(db.myTable) return locals() and here's what I get: https://lh4.googleusercontent.com/-CPjxo21rh2U/VEC6M40E8QI/Ftk/JiW3ZBbFcUg/s1600/w2pFloatBug.png Float field is not in the dropdown list, any ideas ? I'm using web2py Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 on windows platform (downloaded 2 days ago from web2py website). Thanks for helping, -Mirko On Thursday, October 16, 2014 5:03:12 PM UTC+2, Mirko wrote: Sorry, is the float search implemented in grid and smartgrid? I have a table with date, string and float fields and float fields are not searchable. Thanks, -Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: float field search and grid/smartgrid
Hi all, maybe I should elaborate a little bit more: here's my model: db.define_table('myTable', Field('myDate','datetime'), Field('myString','string'), Field('myFloat','float'), ) here's my controller: def index(): grid = SQLFORM.smartgrid(db.myTable) return locals() and here's what I get: https://lh4.googleusercontent.com/-CPjxo21rh2U/VEC6M40E8QI/Ftk/JiW3ZBbFcUg/s1600/w2pFloatBug.png Float field is not in the dropdown list, any ideas ? I'm using web2py Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 on windows platform (downloaded 2 days ago from web2py website). Thanks for helping, -Mirko On Thursday, October 16, 2014 5:03:12 PM UTC+2, Mirko wrote: Sorry, is the float search implemented in grid and smartgrid? I have a table with date, string and float fields and float fields are not searchable. Thanks, -Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Have tickets delivered via email
There's a tickets2email.py file in scripts folder. Works like a charm. hth - Mirko On Thursday, October 16, 2014 3:02:58 PM UTC+2, Jim S wrote: I looked through the book and the the forum here but can't find the answer. Is there a way to configure it so that all web2py tickets are sent to me via email? If I've missed it in the book, could someone please point it out to me? -Jim -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] float field search and grid/smartgrid
Sorry, is the float search implemented in grid and smartgrid? I have a table with date, string and float fields and float fields are not searchable. Thanks, -Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: DAL update expressions starting with an integer not working?
I never updated data this way before, and after having made some tests, it turns out that db.table.lft type is a Field that is converted into a string and then an integer later (I don't know how). And I try the example from the book db(db.table.lft0).update(lft=db.table.lft+1) appends the string '1' to the value (casted to string) of db.table.lft (this seems very weird to me because db.table.lft type is Field) For example if db.table.lft (Field, type int) row value is 12345, db.table.lft+1 after db update will give 123451 Or am I missing something ? On Wednesday, May 28, 2014 8:21:56 AM UTC, Marian wrote: I want to negate a value with this expression: db(db.table.lft 0).update(lft = 0 - db.table.lft) but I get the following TypeError: TypeError: unsupported operand type(s) for -: 'int' and 'Field' My workaround is: db(db.table.lft 0).update(lft = db.table.lft - db.table.lft - db.table.lft) *It seems that update expression need to start with the field or do I miss something?* -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py][Javascript] Massimo here searching for some javascript devs ready to port web2py in JS
April's fool ! :) 2014-04-01 17:44 UTC, Richard ml.richard.vez...@gmail.com: Hello, I want to get rid of python entirely. As you probably know, I don't see great future in Python 3000 and since we can't fighting the Javascript dominance in webapp development world, I resign... I want to port web2py to javascript by rewriting all piece of it except the DAL because it too good and I like it! Is there any volonteers? Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Export issues
Hi all, I downloaded web2py from trunk on Jan 29th and I found some issues with export. Here's the use case: db.define_table('gender',Field('sex'),format='%(sex)s') db.define_table('friend',Field('forename'),Field('gender_id','reference gender'),format='%(forename)s') def manage_friends(): grid = SQLFORM.grid(db.friend) return locals() The problem is that the sex gender string is retrieved along with the forename string for html and tsv exports, but not for csv, xml and json exports. Any thoughts ? Thanks a lot, - Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Export issues
No, same behavior with web2py 2.5.1-stable On Friday, January 31, 2014 9:45:28 AM UTC, Alan Etkin wrote: Hi all, I downloaded web2py from trunk on Jan 29th and I found some issues with export. Did you have a consistent output on earlier versions? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Export issues
ok I will 2014-01-31 Alan Etkin spame...@gmail.com: No, same behavior with web2py 2.5.1-stable Then I think it should be fixed in trunk. Can you file an issue? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Export issues
Done. https://code.google.com/p/web2py/issues/detail?id=1866 On Friday, January 31, 2014 10:43:33 AM UTC, Alan Etkin wrote: No, same behavior with web2py 2.5.1-stable Then I think it should be fixed in trunk. Can you file an issue? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Possibly a problem with CAS redirection in v2.8.2
Hi, some time ago I had a similar issue that I solved this way : https://groups.google.com/d/msg/web2py/FhtokyNZT7k/QEFQOdMzIP4J Hope it helps, Mirko On Friday, December 20, 2013 8:05:10 PM UTC, viniciusban wrote: Hi guys, I'm playing around with CAS and faced this error: begin here The webpage at http://localhost:8000/cas/default/user/cas/login?service=http://localhost:8000/consumer/default/user/login# has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer. Error code: ERR_TOO_MANY_REDIRECTS end here It occurs in v2.8.2, but not in v2.7.4. My scenario is simple: 1- One CAS provider application, called cas. Actually, a raw copy of welcome application. Nothing more, nothing less. 2- One CAS consumer, called consumer. Another copy of welcome application with just one single modification in db.py: auth = Auth(db, cas_provider=http://localhost:8000/cas/default/user/cas;) 3- In consumer application, I have a default.py/protected() function with @auth.requires_login() decorator. The workflow to reproduce the error is: 1) Try to go to http://localhost:8000/consumer/protected. 2) The login form will show up (from cas application). 3) When I fill the form and click submit, the error happens. Is there anything I must configure in v2.8.2 to allow CAS to work out? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Important New Year News: Edison Award
Way to go !! Congrats ! 2014/1/5 Cliff Kachinske cjk...@gmail.com Best of luck. Hope you (and web2py) bring back an award. On Friday, January 3, 2014 11:08:38 PM UTC-5, Massimo Di Pierro wrote: Web2py/me have been nominated for the Edison Award. Please wish web2py (and me) good luck. :-) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Happy New Year everybody!
Happy new year! 2014/1/5 Calvin calvin@gmail.com Happy New year Massimo and all the contributors who have made web2py so awesome! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: github - please follow
done On Saturday, August 24, 2013 11:26:03 PM UTC, Massimo Di Pierro wrote: web2py has many users but few github followers. This is a problem because the number of followers is a metric that can be used to guess popularity. You can help. Get a github account and click on the star. https://github.com/web2py/web2py It costs nothing and has benefits. For example you can receive notificatios when we make improvements. Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] web2py show() function. (explanation of a line of code)
0=first arg cast=int = convert it into int (it is a string actually) IMHO 2013/12/15 deepak sandhu colirs...@gmail.com so this is a function show() which I am trying to understand. in the model I do have a db.image table where I stored some images which is pointed in the function. the only line I am not understanding here is #image = db.image(request.args(0,cast=int)) In request.args(0, cast=int) why it has 0 as argument? and what does cast=int does? the complete function is below: def show(): image = db.image(request.args(0,cast=int)) or redirect(URL('index')) return dict(image=image) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Estore (new!)
https://github.com/pierrenoizat/webshop Written in RoR . A web2py port shouldn't be too difficult... On Monday, November 18, 2013 10:54:56 PM UTC+1, samuel bonill wrote: also, might be a good idea that could accept bitcoin payments... 2013/11/18 samuel bonill pytho...@gmail.com javascript: hi massimo, how i can do a pull request for this aplicacion ?, is a repository with a lot of aplicacions, would be a great idea, put this app in an separate repository El lunes, 18 de noviembre de 2013 15:06:21 UTC-5, Massimo Di Pierro escribió: I have posted a new Estore application: https://github.com/mdipierro/web2py-appliances/tree/master/EStore It is minimalist but supports: - multiple products - product subtypes (for example t-shirt sizes) - categories - discounts (2x 3x 4x 5x 10x) - shipping options (not shipping cost calculations yet) - ajax shopping cart - volume, weight, and tax calculations - checkout with stripe.com using the new PCI compliant JavaScript API I could use some help with: - testing - edit models/plughin_shipping.py to integrate https://www.easypost.com/ - improve the management interface for creating new products, and view transactions Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/IKJBgBI8cFo/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: grid layout problem
Hi Stefan, how do you make the new buttons created by links stick close to the delete, edit, .. buttons under the same header ? Thanks! On Tuesday, October 8, 2013 2:06:13 PM UTC+2, stefaan wrote: Hello all, I noticed the following when using a grid with some links (custom buttons) put at the left, using the default layout (and using ui-style web2py): - when the grid is on a large screen, the custom button column takes too much space - on a small screen, the custom buttons overlap with the text in the next column of the grid I have attached 2 screenshots illustrating the problem. Is this a problem with web2py's default css ? Or do I need to use different grid options? I create the grid with the following options: form = SQLFORM.grid(ui='web2py', formname='formindex', fields=[db.t_seminar.f_date, db.t_seminar.f_start_time, db.t_seminar.f_speaker_string, db.t_seminar.f_location_string, db.t_seminar.f_title_string,db.t_seminar.created_by], query=((db.t_seminar.f_date = datetime.datetime.now().date()) (db.t_seminar.f_tentative != True)), onupdate=__archive_and_reload, editable=__userowned, create=auth.has_membership('admin'), deletable=__userowned, details=True, searchable=True, sortable=True, orderby = [db.t_seminar.f_date, db.t_seminar.f_start_time, db.t_seminar.f_title_string], links = [__define_button, __attendants], buttons_placement=left, links_placement=left, paginate=10) Best regards, Stefaan. https://lh5.googleusercontent.com/-bMVSBL5HjJk/UlPyZYkkLjI/ASs/af-4CTzhe4U/s1600/overlap.png https://lh5.googleusercontent.com/-2hrq-wqeeUA/UlPyebasP2I/AS0/kc9CK-WVlPg/s1600/toomuch.png -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: add new button in GRID with same look and feel
Hi Sarbjit, did you manage to have the placement of your button under the same header where the default grid buttons are ? I'm also unsuccessful here... Thanks! Mirko On Sunday, November 3, 2013 4:45:55 AM UTC+1, Sarbjit wrote: I have added a new button in grid using links as below :- links = [dict(header='', body=lambda row: A('CustomButton',_class=w2p_trap button btn, _href=URL('customhandler',args=[row.id])))] Is it possible that I can have the placement of this button under the same header where the default grid buttons ('Edit','View' or 'Delete') are placed and this should have the same look and feel. Otherwise, the new button looks very odd in the grid from the other buttons, view/edit pages are OK as the new button is aligned with existing buttons. Its just the main grid layout which requires modification. Any pointers/suggestions? Can I have the new button visible only under Edit/View and not under main grid (This is better than the odd look). -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: add new button in GRID with same look and feel
Just figured out how to do that : links=[ {'header':'...','body':lambda row: ...}, lambda row: TAG.button(T('Accept'),_type=button,_onclick='alert(%s)' %row.id) ] the second item of links list goes with the delete/view/edit buttons... Hope it helps, Mirko On Friday, November 15, 2013 9:37:20 AM UTC+1, Sarbjit wrote: Hi Mirko, I am not able to figure out a way so far :( But I feel the best way is to create a new header and add existing buttons (Add/Delete/View) in them along with other buttons. But I still need to figure out how this can be done i.e. passing the correct arguments (signature) etc. -Sarbjit -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: grid layout problem
Hi Stefaan, just find the answer and posted it here : https://groups.google.com/d/msg/web2py/LhuZvOAv_K4/Y11Ap1QCEYwJ Hope it helps, Mirko On Friday, November 15, 2013 10:01:24 AM UTC+1, stefaan wrote: Hi Mirko, short answer: I have no idea really, it just came out like that, but here's what I did that might influence the result: 1. I think these are the relevant options I passed to my grid: ui='web2py', ... buttons_placement=left, links_placement=left, 2. I adjusted the css based on the suggestions in this thread: https://groups.google.com/d/topic/web2py/cWhQla9a2Sc/discussion (I'm not sure if that was already the case when I originally posted the question) Best regards, Stefaan. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] grid links appearing in details
Hi all, I have grid links appearing in details, on the same row than the 'back' and 'edit' buttons. How can I make them not display ? Thanks ! Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: grid links appearing in details
Yes, but they disappear from the grid as well... On Friday, November 15, 2013 4:21:15 PM UTC+1, 黄祥 wrote: had you already try to set links=None? ref: http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM.grid-signature best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: grid links appearing in details
lol, it does that also in edit... I have another grid for which I don't see this behaviour, I have to figure out why... btw, I'm using 2.5.1 On Friday, November 15, 2013 4:52:07 PM UTC+1, Anthony wrote: You can do something like: links='view' not in request.args Anthony On Friday, November 15, 2013 10:43:36 AM UTC-5, Mirko wrote: Yes, but they disappear from the grid as well... On Friday, November 15, 2013 4:21:15 PM UTC+1, 黄祥 wrote: had you already try to set links=None? ref: http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM.grid-signature best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] A helper and delete argument
Hi all, when I try to use the example from the book below, ( the-views#Built-in-helpershttps://jurokk.edqm.eu:8000/book/default/chapter/29/05/the-views#Built-in-helpers ) {{=A('click me', callback=URL('myaction'), delete='tr)}} the behavior is: * delete warning popup appear * html table row is deleted * table row is not deleted I'm very happy with this behavior except that I was wondering if it's possible not make the popup appear as long as the table row is not deleted ? Thanks! Mirko web2py 2.5.1 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Web Framework Benchmarks
http://www.techempower.com/benchmarks/ A lot of web frameworks but no web2py in this list... :( -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: One of the best things that happened to web2py
2.7.4 , great ! On Monday, October 28, 2013 5:41:35 PM UTC+1, Massimo Di Pierro wrote: I am happy to announce a great new opportunity for web2py users: https://www.pythonanywhere.com/try-web2py Basically they give you the opportunity to create a web2py instance directly from the browser without sign-up. The instance only lives for 24 hrs unless you sign-up. In that case it will persist. The basic plan is also free. This is a great new way to show web2py to your friends and convince them to try it without commitment. It also works great for teaching web2py. I encourage you to try it. web2py.com is hosted on PythonAnywhere and we are very happy with it. Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: new feature in trunk
Hi Massimo, this is a very promising feature ! My quick two cents: Why not turn this generic by replacing the 'body' field with a 'node_name' field and add an attribute node table ? For example: db.define_table('node', Field('parent_id','reference node'), Field('node_name','string')) and db.define_table('attribute', Field('node_id','reference node'), Field('key','string'), Field('value','string')) The tree definition above needs to create a fake root node, forces a given node to belong to only one parent node and is efficient when traversing tree from leaf to trunk but for a given node the children node(s) are unknown. The tree definition below could be a better solution, but may require extra work to keep references integrity especially when moving or deleting nodes: db.define_table('node', Field('parent_id','list:reference node'), Field('child_id','list:reference node'), // sorting this may permit to manage siblings Field('node_name','string')) Eventually a delirious attribute table evolution might be to have a type field (string, integer, reference, ) and validator per node attribute, but I can't figure out how to do that :) Thanks again for this new feature, Mirko, PS: btw, no plans for DAL ZODB support ? http://www.zodb.org/en/latest/documentation/guide/introduction.html On Monday, October 21, 2013 5:57:00 AM UTC+2, Massimo Di Pierro wrote: It is a recurrent problem that is displays tree-like structures like threaded comments. For example: db.define_table('post', Field('parent_id','reference post'), Field('body')) where each comment has a body and a parent_id (parent_id==None for the root comment(s)) We can populate the comments with some dummy data: def make_up_data(): import random, uuid ids = [None] for k in range(100): ids.append(db.post.insert(parent_id=random.choice(ids), body=str(uuid.uuid4( if k==0: ids.pop(None) if db(db.post).isempty(): make_up_data() The new feature in trunk allows you to select the comments are organized them into trees. roots = db(db.post).select().as_trees() This returns a list of parent nodes. Each not stores its own children, recursively. Now you can print them all using a tree traversal: def show(row,n=0): return ' '*n+row.body+'\n'+''.join(show(c,n+1) for c in row.children) print show(roots[0]) Notice you can specify the name of the parent field: roots = db(db.post).select().as_trees(parent_name=parent_id) Please let me know if you think this can be improved. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] web2py jenkins
Hi there, does anybody here know how to set up jenkins to run python web2py.py --run_system_tests ? It works like a charm from command line but fails when launched from jenkins... (looks like some of the very last tests are evaluated before their real end, threading and/or new web2py httpd instance launch might be a clue). Thanks! Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: CAS Auth redirect loop
Hi all, being on a LAN and behind a proxy, I solved this with: export https_proxy= export http_proxy= (on a linux box) Cas auth is working like a charm after that :) Hope it helps, Mirko On Wednesday, August 17, 2011 8:36:45 PM UTC+2, Bruno Codeman wrote: Hi again, everyone. Does anyone know why a CAS auth could be entering a loop redirect? -- Bruno de Oliva Bemfica *Engenheiro de Software* MSN: brunoc...@live.com javascript: Mobile: +55 11 8457-0978 http://www.devfranca.com.br http://www.brunobemfica.net http://www.codigofree.net -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: web2py 2.7.1 is OUT
Hi, Is it this one ? https://github.com/mdipierro/web2py-book Thanks, Mirko On Monday, October 7, 2013 3:36:09 AM UTC+2, Tim Richardson wrote: the trunk version of the book available on GIT is as up to date as possible (and a lot more recent than the version linked to on the website). The book is simply a web2py app, so you can git clone it into a web2py applications directory and hey presto, you've got the latest version. On Saturday, October 5, 2013 10:20:21 PM UTC+10, Arnon Marcus wrote: How updated are the documentation? What version does the book reflect? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Issue running doctest with decorated functions
Done here : https://code.google.com/p/web2py/issues/detail?id=1703 A possible workaround could be to add the following lines somewhere where it is always called (cmd_options.test is None for normal use): if request.global_settings.cmd_options.test: auth.login_bare('userlogin','userpassword') On Thursday, October 3, 2013 10:55:01 PM UTC+2, Massimo Di Pierro wrote: please open a ticket about this. we need a new request.is_shell option or something similar to detect this state. On Thursday, 3 October 2013 09:52:07 UTC-5, Mirko wrote: Eventually I got something working (may be crappy) to put on top of controller file: *if request.global_settings.cmd_options.test.startswith('%s/%s' % (request.application,request.controller)): auth.login_bare('user_for_test','his/her password') * Mirko On Thursday, October 3, 2013 3:58:31 PM UTC+2, Mirko wrote: Hi Massimo, thank you very much for helping! However it looks like request.function contains '_TEST' only when doctest is run from the web IDE, and contains function name when run from command line.. On Thursday, October 3, 2013 3:25:24 PM UTC+2, Massimo Di Pierro wrote: You need to add some logic that says: if request.function = '_TEST': auth.login_bare('user_for_test','his/her password') On Thursday, 3 October 2013 07:02:09 UTC-5, Mirko wrote: Hi all, I confirm *python web2py.py -T a/b/c* is not working with 2.5.1 when function c is decorated with *@auth.requires_login()* It works fine without that decoration and I don't know how to authenticate when running doctests from command line, any suggestions ? Many thanks! Mirko On Friday, October 16, 2009 5:11:49 PM UTC+2, mdipierro wrote: I cannot say on top of my head. I would look into the build_environment when/where that is set. Thanks for looking into this. It is an important problem that needs to be solved. Massimo On Oct 16, 10:03 am, rboissat r.bois...@gmail.com wrote: One issue though, with the code given above for instantiating a dummy env, I get this traceback:http://oxynux.org/pastebin/lbc6tu-534 It seems that in the line: SQLDB._set_thread_folder(os.path.join(request.folder, 'databases')) request.folder is NoneType, therefore making os.path.join fail. This is rather odd, cause in the tested controller, a: print request.folder gives me the the right path to my application. Any idea? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] reference type field issue when requires is set ?
Hi all, when I use this db definition: db.define_table('gender', Field('name'), format='%(name)s') db.define_table('person', Field('name'), Field('gender_id','reference gender'), format='%(name)s') db.define_table('thing', Field('name'), Field('owner_id','reference person' ,format='%(name)s') with this controller: @auth.requires_login() def mytest(): grid=SQLFORM.smartgrid(db.thing) return dict(grid=grid) the owner_id's name is displayed when function above is called, but if I want to restrict owner_id (to male only for example) with this : db.thing.owner_id.requires=IS_IN_DB(db(db.person.gender_id==db.gender(name= 'M').id),'person.id') the owner_id's name is not displayed anymore, I see the owner id instead. I found a workaround by using db.thing.owner_id.represent but I was wondering if this is a bug ? Thanks! Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] smartgrid with linked tables url hacking
Hi all, with this db definition: db.define_table('gender', Field('name'), format='%(name)s') db.define_table('person', Field('name'), Field('gender_id','reference gender'), format='%(name)s') db.define_table('thing', Field('name'), Field('owner_id','reference person' ),format='%(name)s') and this controller: @auth.requires_login() def mytest(): grid=SQLFORM.smartgrid(db.person,linked_tables=dict(person=['thing'])) return dict(grid=grid) Hacking url by removing pieces is very well managed except for this case : * https://myserver/myapp/mycontroller/mytest/person/thing.owner_id* , for which breadcrumb displays a weird *Persons Unknown Things* ... Is it a bug ? Thanks! Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: reference type field issue when requires is set ?
Hi Anthony, the issue I am pointing to is related to the display of the owner_id values in the grid itself and yes, my *real* code sets the requires attribute directly in the thing table definition rather than after the fact as shown above, I didn't think that this would make a difference, sorry about that... On Friday, October 4, 2013 3:31:39 PM UTC+2, Anthony wrote: db.define_table('gender', Field('name'), format='%(name)s') db.define_table('person', Field('name'), Field('gender_id','reference gender'), format='%(name)s') db.define_table('thing', Field('name'), Field('owner_id','reference person',format='%(name)s') with this controller: @auth.requires_login() def mytest(): grid=SQLFORM.smartgrid(db.thing) return dict(grid=grid) the owner_id's name is displayed when function above is called, but if I want to restrict owner_id (to male only for example) with this : db.thing.owner_id.requires=IS_IN_DB(db(db.person.gender_id==db.gender( name='M').id),'person.id') Are you saying the problem is with the display of the owner_id values in the grid itself, or in the drop-down in create/edit forms? The above code will not affect the display in the grid, only in drop-downs (unless your *real* code sets the requires attribute directly in the thing table definition rather than after the fact as shown above). Assuming the problem is in the dropdown, note that IS_IN_DB takes a label argument, which you can set to the _format attribute of the referenced table: db.thing.owner_id.requires=IS_IN_DB(db(db.person.gender_id==db.gender(name ='M').id), 'person.id', db.person._format) Note, if you set the requires attribute of the reference field within the table definition itself (i.e., via Field(..., requires=...)), then you will not get the default represent attribute, which means the grid itself will only display the id's. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Issue running doctest with decorated functions
Hi all, I confirm *python web2py.py -T a/b/c* is not working with 2.5.1 when function c is decorated with *@auth.requires_login()* It works fine without that decoration and I don't know how to authenticate when running doctests from command line, any suggestions ? Many thanks! Mirko On Friday, October 16, 2009 5:11:49 PM UTC+2, mdipierro wrote: I cannot say on top of my head. I would look into the build_environment when/where that is set. Thanks for looking into this. It is an important problem that needs to be solved. Massimo On Oct 16, 10:03 am, rboissat r.bois...@gmail.com wrote: One issue though, with the code given above for instantiating a dummy env, I get this traceback:http://oxynux.org/pastebin/lbc6tu-534 It seems that in the line: SQLDB._set_thread_folder(os.path.join(request.folder, 'databases')) request.folder is NoneType, therefore making os.path.join fail. This is rather odd, cause in the tested controller, a: print request.folder gives me the the right path to my application. Any idea? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Issue running doctest with decorated functions
Hi Massimo, thank you very much for helping! However it looks like request.function contains '_TEST' only when doctest is run from the web IDE, and contains function name when run from command line.. On Thursday, October 3, 2013 3:25:24 PM UTC+2, Massimo Di Pierro wrote: You need to add some logic that says: if request.function = '_TEST': auth.login_bare('user_for_test','his/her password') On Thursday, 3 October 2013 07:02:09 UTC-5, Mirko wrote: Hi all, I confirm *python web2py.py -T a/b/c* is not working with 2.5.1 when function c is decorated with *@auth.requires_login()* It works fine without that decoration and I don't know how to authenticate when running doctests from command line, any suggestions ? Many thanks! Mirko On Friday, October 16, 2009 5:11:49 PM UTC+2, mdipierro wrote: I cannot say on top of my head. I would look into the build_environment when/where that is set. Thanks for looking into this. It is an important problem that needs to be solved. Massimo On Oct 16, 10:03 am, rboissat r.bois...@gmail.com wrote: One issue though, with the code given above for instantiating a dummy env, I get this traceback:http://oxynux.org/pastebin/lbc6tu-534 It seems that in the line: SQLDB._set_thread_folder(os.path.join(request.folder, 'databases')) request.folder is NoneType, therefore making os.path.join fail. This is rather odd, cause in the tested controller, a: print request.folder gives me the the right path to my application. Any idea? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Issue running doctest with decorated functions
Eventually I got something working (may be crappy) to put on top of controller file: *if request.global_settings.cmd_options.test.startswith('%s/%s' % (request.application,request.controller)): auth.login_bare('user_for_test','his/her password') * Mirko On Thursday, October 3, 2013 3:58:31 PM UTC+2, Mirko wrote: Hi Massimo, thank you very much for helping! However it looks like request.function contains '_TEST' only when doctest is run from the web IDE, and contains function name when run from command line.. On Thursday, October 3, 2013 3:25:24 PM UTC+2, Massimo Di Pierro wrote: You need to add some logic that says: if request.function = '_TEST': auth.login_bare('user_for_test','his/her password') On Thursday, 3 October 2013 07:02:09 UTC-5, Mirko wrote: Hi all, I confirm *python web2py.py -T a/b/c* is not working with 2.5.1 when function c is decorated with *@auth.requires_login()* It works fine without that decoration and I don't know how to authenticate when running doctests from command line, any suggestions ? Many thanks! Mirko On Friday, October 16, 2009 5:11:49 PM UTC+2, mdipierro wrote: I cannot say on top of my head. I would look into the build_environment when/where that is set. Thanks for looking into this. It is an important problem that needs to be solved. Massimo On Oct 16, 10:03 am, rboissat r.bois...@gmail.com wrote: One issue though, with the code given above for instantiating a dummy env, I get this traceback:http://oxynux.org/pastebin/lbc6tu-534 It seems that in the line: SQLDB._set_thread_folder(os.path.join(request.folder, 'databases')) request.folder is NoneType, therefore making os.path.join fail. This is rather odd, cause in the tested controller, a: print request.folder gives me the the right path to my application. Any idea? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] smartgrid and represent
Hi, I'm using 2.5.1 and I defined a table with a default format which I override in my controller with represent attribute and then I call smartgrid on another table referencing the first one. When I call the controller, smartgrid shows a tabular display and the representation I overrode is taken into account, the correct string representation is displayed, fine. But when I click on add button or edit button, it appears that the default format is used for the dropdown list. I've tried many workarounds unsuccessfully, but I'm sure the new representation code line is executed and it looks like on creation or editing smartgrid is reloading the table definition after that... Or I'm I missing something ? Thanks in advance! Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: smartgrid and represent
Here's a code example : db definition: db.define_table('person', Field('name'), format='%(name)s') db.define_table('thing', Field('name'), Field('owner_id','reference person'), format='%(name)s') controller: def manage_test(): db.thing.owner_id.represent=lambda id, row: '%s' % db.person[row.owner_id].name.upper() grid=SQLFORM.smartgrid(db.thing) return dict(grid=grid) db.thing.owner_id.represent is not taken into account when click on add or edit button. Many thanks! On Friday, September 27, 2013 10:47:38 AM UTC+2, Mirko wrote: Hi, I'm using 2.5.1 and I defined a table with a default format which I override in my controller with represent attribute and then I call smartgrid on another table referencing the first one. When I call the controller, smartgrid shows a tabular display and the representation I overrode is taken into account, the correct string representation is displayed, fine. But when I click on add button or edit button, it appears that the default format is used for the dropdown list. I've tried many workarounds unsuccessfully, but I'm sure the new representation code line is executed and it looks like on creation or editing smartgrid is reloading the table definition after that... Or I'm I missing something ? Thanks in advance! Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Virtual Fields and Smartgrid not working as expected
Hi, I confirm this error here with 2.5.1 Ciao ciao Mirko On Thursday, September 19, 2013 10:49:35 AM UTC+2, hiro wrote: In the book I read: *Showing virtual fields in SQLFORM.grid and smartgrid* In recent versions of web2py, virtual fields are shown in grids like normal fields: either shown alongside all other fields by default, or by including them in the fields argument. However, virtual fields are not sortable. However, if i use the welcome app and define: db.define_table('entity', Field('entity_name', 'string'), Field('slogan', 'string'), Field.Virtual('slogan2', lambda row: row.entity.slogan+', it is really the best.') ) and then create a grid: def index(): my_grid = SQLFORM.grid(db.entity) return locals() Reading the book I expect this to work. However I get the error 'Query Not Supported: no such column: entity.slogan2' in the smartgrid. Massimo, is this related to to the same bug I asked about yesterday? (I have not yet updated my web2py to trunk, but did not find anything about this issue in the tracker.) One solution might be to change the Virtual Fiels to computed fields. A big hug to all web2py contributors! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: smartgrid and represent
Hi Anthony, and thanks for answering. Actually db.person._format = lambda row: '%s' % row.name.upper() doesnt not affect the dropdown list building... I had to add this db.thing.owner_id.requires=IS_IN_DB(db,'person.id',lambda row: '%s' % row.name.upper()) to have the dropdown list in upper case... On Friday, September 27, 2013 2:54:17 PM UTC+2, Anthony wrote: The dropdown on a create/edit form is not controlled by the field's represent attribute -- instead, it is the field's IS_IN_DB validator that creates the dropdown. So, you could either manually override the default IS_IN_DB validator, or just change the db.person._format attribute, which will affect both the represent attribute and the IS_IN_DB validator of db.thing.owner_id: db.person._format = lambda r: r.name.upper() Note, with the above, you no longer need to explicitly change the db.thing.owner_id.represent attribute. Anthony On Friday, September 27, 2013 7:30:13 AM UTC-4, Mirko wrote: Here's a code example : db definition: db.define_table('person', Field('name'), format='%(name)s') db.define_table('thing', Field('name'), Field('owner_id','reference person'), format='%(name)s') controller: def manage_test(): db.thing.owner_id.represent=lambda id, row: '%s' % db.person[row.owner_id].name.upper() grid=SQLFORM.smartgrid(db.thing) return dict(grid=grid) db.thing.owner_id.represent is not taken into account when click on add or edit button. Many thanks! On Friday, September 27, 2013 10:47:38 AM UTC+2, Mirko wrote: Hi, I'm using 2.5.1 and I defined a table with a default format which I override in my controller with represent attribute and then I call smartgrid on another table referencing the first one. When I call the controller, smartgrid shows a tabular display and the representation I overrode is taken into account, the correct string representation is displayed, fine. But when I click on add button or edit button, it appears that the default format is used for the dropdown list. I've tried many workarounds unsuccessfully, but I'm sure the new representation code line is executed and it looks like on creation or editing smartgrid is reloading the table definition after that... Or I'm I missing something ? Thanks in advance! Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: smartgrid and represent
Hi Anthony, it is working now, sorry for the inconvenience. Thanks again! On Friday, September 27, 2013 4:40:05 PM UTC+2, Anthony wrote: Can you show your exact code (the code you showed can't be the code you're using, as there would be no add or edit buttons with that code)? It definitely works when I try it. Anthony On Friday, September 27, 2013 9:22:37 AM UTC-4, Mirko wrote: Hi Anthony, and thanks for answering. Actually db.person._format = lambda row: '%s' % row.name.upper() doesnt not affect the dropdown list building... I had to add this db.thing.owner_id.requires=IS_IN_DB(db,'person.id',lambda row: '%s' % row.name.upper()) to have the dropdown list in upper case... On Friday, September 27, 2013 2:54:17 PM UTC+2, Anthony wrote: The dropdown on a create/edit form is not controlled by the field's represent attribute -- instead, it is the field's IS_IN_DB validator that creates the dropdown. So, you could either manually override the default IS_IN_DB validator, or just change the db.person._format attribute, which will affect both the represent attribute and the IS_IN_DB validator of db.thing.owner_id: db.person._format = lambda r: r.name.upper() Note, with the above, you no longer need to explicitly change the db.thing.owner_id.represent attribute. Anthony On Friday, September 27, 2013 7:30:13 AM UTC-4, Mirko wrote: Here's a code example : db definition: db.define_table('person', Field('name'), format='%(name)s') db.define_table('thing', Field('name'), Field('owner_id','reference person'), format='%(name)s') controller: def manage_test(): db.thing.owner_id.represent=lambda id, row: '%s' % db.person[row.owner_id].name.upper() grid=SQLFORM.smartgrid(db.thing) return dict(grid=grid) db.thing.owner_id.represent is not taken into account when click on add or edit button. Many thanks! On Friday, September 27, 2013 10:47:38 AM UTC+2, Mirko wrote: Hi, I'm using 2.5.1 and I defined a table with a default format which I override in my controller with represent attribute and then I call smartgrid on another table referencing the first one. When I call the controller, smartgrid shows a tabular display and the representation I overrode is taken into account, the correct string representation is displayed, fine. But when I click on add button or edit button, it appears that the default format is used for the dropdown list. I've tried many workarounds unsuccessfully, but I'm sure the new representation code line is executed and it looks like on creation or editing smartgrid is reloading the table definition after that... Or I'm I missing something ? Thanks in advance! Mirko -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: How to leverage web2py popularity and usage?
I'm interested in. Julie Bouillon julie.bouil...@yedia.com a écrit : If there's enough enough bloggers out there writing about web2py, I'll be happy to put a planet web2py in place. Just let me know if there's an interest for that. Julie On 09/07/2013 06:01 PM, Massimo Di Pierro wrote: yes the number time distance between releases has increased, mostly because the new features we are adding are more complex (or would have done it before). I do not know about the number of users. I definitively think we need more people to blog about web2py. massimo On Saturday, 7 September 2013 05:07:53 UTC-5, LightDot wrote: I'm always sorry to see a good open source project with little or no documentation and a myriad of them are in this sad state. Luckily, web2py doesn't have this problem. The existence of the documentation is this fairly complete form is one of the reasons I chose web2py over other python frameworks. I don't think having 40 pages more or less would make me consider web2py faster or slower. But a lack of a chapter in the book might have made me choose another framework. I agree that new users need simple examples, but not at the expense of an in depth manual. If there is a consensus that web2py book can be intimidating for a complete begginer, perhaps someone can write a short My first web2py project in a book form, or something similar? I personally think this can be better served with blog articles and publishing of slices. Perhaps the growh of web2py userbase has slowed a bit..? I'm not sure that it did though. I don't have any insight into statistics to think one way or another and I don't trust my perception with this. What did slow down is the pace of web2py releases, hasn't it? The period between releases is longer than it used to be. On Saturday, September 7, 2013 9:54:45 AM UTC+2, webpypy wrote: As Massimo said, the main advantage/objective of web2py framework is to be the easiest and fastest to develop web applications. I think the rate of growing popularity/interest was high for versions 2.0 , compared with versions = 2.0 . Maybe because of the big size of manual for versions 2.0 , The big manual means it is not expected to be the easiest and fastest anymore. I suggest explaining the features through well documented examples/appliances, keeping the manual small... -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] required=True for Field type=list:reference
Hi, I expected this to be validated when at least one entry is selected but validation let this pass when nothing is selected. Any ideas ? Thanks, Mirko PS: after validation, the correponding db field contains || which may be should be considered as an empty value by the DAL ? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: required=True for Field type=list:reference
Ok, but if the default validator for a list:reference field does allow zero options to be selected, required=True and required=False makes no difference, isn't it ? Thanks, Mirko On Monday, September 2, 2013 3:15:18 PM UTC+2, Anthony wrote: Note, IS_IN_DB(..., multiple=True), which is the default validator for a list:reference field, does allow zero options to be selected, so I suppose the behavior of required=True was made consistent with the validator. Perhaps that should be changed. In any case, using the validator, you can do: IS_IN_DB(db, 'mytable.id', db.mytable._format, multiple=[1, float('inf')]) The multiple argument to IS_IN_DB and IS_IN_SET can be a list/tuple specifying minimum and maximum number of values. Anthony On Monday, September 2, 2013 5:31:33 AM UTC-7, Mirko wrote: Hi, I expected this to be validated when at least one entry is selected but validation let this pass when nothing is selected. Any ideas ? Thanks, Mirko PS: after validation, the correponding db field contains || which may be should be considered as an empty value by the DAL ? -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] web2py newbie question
Hi all, I am really new to web2py and I find this python framework really exciting. I am currently reading the whole online book chapter database validators, and while I was reading at the example given, I was wondering if there is a difference between this : db.define_table('person', Field('name', unique=True)) db.define_table('dog', Field('name'), Field('owner', db.person)) db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s') and this : db.define_table('person', Field('name', unique=True), format='%(name)s') db.define_table('dog', Field('name'), Field('owner', type='reference person', required=True)) Thanks a lot, Mirko -- --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.