[web2py] web2py and sqlite data out of sync
Hi, web2py experts: I encounter a strange issue where web2py fetches less data than what exists in sqlite database Here is a simple app to manage Chinese charactor # model: table def. db.define_table('wg_zi_shape' ,Field('zi','string',label=T('原字')) ,Field('z_upleft','string',label=T('左上')) ,Field('z_upright','string',label=T('右上')) ,Field('z_left','string',label=T('左')) ,Field('z_upper','string',label=T('上')) ,Field('z_center','string',label=T('中')) ,Field('z_lower','string',label=T('下')) ,Field('z_right','string',label=T('右')) ,Field('z_lowleft','string',label=T('左下')) ,Field('z_lowright','string',label=T('右下')) ,Field('z_front','string',label=T('前')) ,Field('z_back','string',label=T('后')) ,Field('note','string',label=T('注明')) ,singular="Form" ,plural="Forms" ) # controller : default.py @auth.requires_login() def zi_shape(): grid = SQLFORM.smartgrid(db.wg_zi_shape,create=True ,deletable=False,formstyle='divs',paginate=50,csv=False) return locals() # view: default/zi_shape.html {{extend 'layout.html'}} {{=grid}} I entered 907 words one-by-one using this form up to last night, Everything works without any issue. This morning, the view shows only 616 records But using Sqlite browser, I see 907 records in storage.sqlite file What could cause this inconsistency? How to resolve it? I will share the .w2p file + the original storage.sqlite file when someone likes to debug this Thanks for your help Wen -- 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: ipython notebook and web2py
This integration is very useful, Thank you Anthony! On Friday, January 8, 2016 at 3:49:33 PM UTC-5, Ron Chatterjee wrote: > > This is great Anthony. For documenting code and standalone application. > Nice! > > On Friday, January 8, 2016 at 1:56:26 PM UTC-5, pepper_bg wrote: >> >> Sorry to resurrect an older thread, do let me know if I should create a >> new one. I had this perfectly working as described in this thread. Then I >> upgraded to Jupyter and things fell apart. The thing just doesn't have >> profiles, startup folders, none of the way iPython Notebook used to set >> things up. Has anybody figured how to make the %w2p magic work with Jupyter? >> > -- 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: REF: Upload of Files
Thanks for sharing the solution, I did not know that quotes_file holds the file content On Friday, March 22, 2013 2:34:16 AM UTC-4, software.ted wrote: Ok great and thanks for all your help, the file is being saved and all works as expected!!! code that works below: def index(): form = SQLFORM.factory(Field(first_name),Field(quotes_file, upload, uploadfolder=os.path.join(request.folder, 'uploads'))) test = '' first_name = '' if request.vars.first_name: first_name = My test if isinstance(request.vars.quotes_file, cgi.FieldStorage): test = My File if form.process().accepted: response.flash = Data Saved elif form.errors: response.flash = Form has error return locals() On Fri, Mar 22, 2013 at 1:21 AM, Anthony abas...@gmail.com javascript:wrote: Recall that the suggestions to forego calling form.process() and instead just check for and directly manipulate request.vars.quotes_file was assuming you did not want to permanently store the file. If you do want to keep the file, then you should call form.process() (or include code to manually save the file). However, it's not clear that you do really need to keep the file. Presumably whatever code you plan to use to process and store the data would first open the file and then work with the open file object -- instead, you should be able to work with the FieldStorage file object directly (i.e., request.vars.quotes_file.file). Anthony On Thursday, March 21, 2013 2:01:01 PM UTC-4, software.ted wrote: But the question again is where is the file stored, its not appearing in the specified uploads directory for manipulation. What I want to do is upload an excel sheet with specific columns of data, then get the data and insert into db with similar columns On Mar 21, 2013 6:48 PM, Anthony abas...@gmail.com wrote: if request.vars.quotes_file: Sorry, I didn't realize this, but apparently if you do if [cgi.FieldStorage object] you get False rather than True, so instead try: if hasattr(request.vars.quotes_**file, file): or import cgi if isinstance(request.vars.quotes**_file, cgi.FieldStorage) I have further noticed this error in the page source after making a submit: var ajax_error_500 = 'An error occured, please a href=/testapp/default/index?**f**irst_name=bggfbfgamp;quotes_**f** ile=FieldStorage%28%27quotes_**f**ile%27%2C+%27rows+%282%29.**csv%** 27%2C+%27circular.**circular_no%**2Ccircular.**recipients%** 2Ccircular.**circular_title%**2Ccircular.**circular_date%5Cr%** 5CnNAZ%2F1%**2F2013%2CALL+**MEMBERS+OF+STAFF%**2CLunch+to+** be+served+at+the+**Motel%2C2013-**03-01%5Cr%5Cn%27%**29reload/**a the page' That is not an error -- it is just a Javascript variable that is automatically generated by web2py_ajax.html. It is there in case there is an Ajax error on the page, in which case it will be used to generate an error message. However, I notice there is an error in the code used to generate that variable -- it should not be including post_vars in the link URL, only get_vars (I have submitted a patch to correct that). Anthony -- --- 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+un...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://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+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- ... Teddy Lubasi Nyambe Opensource Zambia Lusaka, ZAMBIA Cell: +260 97 7760473 website: http://www.opensource.org.zm ~/ Human Knowledge belongs to the world! - AntiTrust Man is a tool-using animal. Without tools he is nothing, with tools he is all - Thomas Carlyle 1795-1881 /~ -- --- 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] Embed MP3 audio player in HTML via web2py
Check out my app at wwwgong.pythonanywhere.com/rpad I embed video mp3 and img I can share the code if interested -- --- 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] Field('upload') : problem with file name
You forgot to create the uploadfolder -- --- 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: Not to open a can of worms ... about web2py.com
I like web2py especially with the recent makeover. However, the web2py logo is kind of plain, why not add some colors to the letters? I am no artist, but attached a draft design. Obviously we need a cute snake cartoon. On Friday, March 15, 2013 10:31:30 PM UTC-4, Richard wrote: Here what come out of my mind for improving favicon... I think the concept is obvious (see attach PNGs files)!! - web2py is essential so it's part of the elements - he has his uniques and distincts set of caracteristics represented subtilly by the fact that his element tile is not totally standard. Not totally true actually because I reduce the 2 in Wpy 2 in the attach png file, in the normal file black on with the 2 is bigger, but since there is no element name web2py... The objective was to enlarge the mains letter in web2py to make the favicon clearer and recognizable, because Derek point this issue above... I just make some black and white sketches, I can tweaks them in differents manner to get a final pitch for a new favicon... The elements tiles are just there for you to understand the concept under the favicon I propose here, they are not going to be into the favicon of course... The web2py below Wpy 2 could go away in the final favicon, I just include it here to make the web2py tile look more like a element tile. If the concept is not to basic we can use them in the site if we are at ease with it... Ciao! Richard On Fri, Mar 15, 2013 at 5:29 PM, dlypka dly...@gmail.com javascript:wrote: The web2py site has its own distinctive look which is very clever. Occasional tweaks are good, but let it follow its current course. Not so sure what that new banner background image (vertical lines) is about though... On Friday, March 15, 2013 4:10:04 PM UTC-5, stefaan wrote: Should it be done? No. -- --- 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+un...@googlegroups.com javascript:. 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. attachment: web2py-logo.jpg
[web2py] smartgrid showing values from cascading foreign tables.
Don't think smartgrid can do that, try to use grid by passing the query joining 4 tables -- --- 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: Tip of the day... ajax buttons in grid
can you explain what triggers view refresh after thing.update_record(active=not thing.active) On Thursday, March 7, 2013 5:09:01 PM UTC-5, wwwgong wrote: I am using v2.4.2 on win7, tried both chrome and firefox, same issue, I have to do a refresh to see Active field checked/unchecked On Thursday, March 7, 2013 4:54:45 PM UTC-5, Massimo Di Pierro wrote: It should update it. it does for me. On Thursday, 7 March 2013 15:43:08 UTC-6, wwwgong wrote: Thanks for the tip, I noticed that the checkbox is not updated after clicking on/off button. how to make active field refresh automatically On Wednesday, March 6, 2013 9:09:41 PM UTC-5, Massimo Di Pierro wrote: Do you know you can do this? db.define_table('thing',Field('name'),Field('active','boolean',default=False)) @auth.requires_login() def index(): grid = SQLFORM.grid(db.thing, inks=[lambda row: A('on' if row.active else 'off', _class='btn', _id='t%i'%row.id, target='t%i'%row.id, callback=URL('activate',args=row.id ))]) return dict(grid=grid) @auth.requires_login() def activate(): if request.env.request_method=='POST': thing = db.thing(request.args(0,cast=int)) thing.update_record(active=not thing.active) return 'on' if thing.active else 'off' It makes Ajax buttons which toggle on/off the value of thing.active field for each row. -- --- 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: Book 5th edition out
I tried Table Inheritance feature, it works like a charm. THANK YOU SO MUCH! On Tuesday, March 5, 2013 3:48:38 PM UTC-5, mdipierro wrote: The fifth edition of the book is out! in HTML: http://web2py.com/book in PDF: https://dl.dropbox.com/u/18065445/web2py/web2py_manual_5th.pdf and in print: http://www.lulu.com/shop/massimo-di-pierro/web2py-5th-edition/paperback/product-20731496.html -- --- 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: Book 5th edition out
Thanks, your little app may be customized for translation, where to see the source code? On Wednesday, March 6, 2013 7:27:34 PM UTC-5, Alan Etkin wrote: kindly hosted by github. http://niphlod.github.com/diffbook/ Many thanks! -- --- 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: Tip of the day... ajax buttons in grid
Thanks for the tip, I noticed that the checkbox is not updated after clicking on/off button. how to make active field refresh automatically On Wednesday, March 6, 2013 9:09:41 PM UTC-5, Massimo Di Pierro wrote: Do you know you can do this? db.define_table('thing',Field('name'),Field('active','boolean',default=False)) @auth.requires_login() def index(): grid = SQLFORM.grid(db.thing, inks=[lambda row: A('on' if row.active else 'off', _class='btn', _id='t%i'%row.id, target='t%i'%row.id, callback=URL('activate',args=row.id))]) return dict(grid=grid) @auth.requires_login() def activate(): if request.env.request_method=='POST': thing = db.thing(request.args(0,cast=int)) thing.update_record(active=not thing.active) return 'on' if thing.active else 'off' It makes Ajax buttons which toggle on/off the value of thing.active field for each row. -- --- 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: Tip of the day... ajax buttons in grid
I am using v2.4.2 on win7, tried both chrome and firefox, same issue, I have to do a refresh to see Active field checked/unchecked On Thursday, March 7, 2013 4:54:45 PM UTC-5, Massimo Di Pierro wrote: It should update it. it does for me. On Thursday, 7 March 2013 15:43:08 UTC-6, wwwgong wrote: Thanks for the tip, I noticed that the checkbox is not updated after clicking on/off button. how to make active field refresh automatically On Wednesday, March 6, 2013 9:09:41 PM UTC-5, Massimo Di Pierro wrote: Do you know you can do this? db.define_table('thing',Field('name'),Field('active','boolean',default=False)) @auth.requires_login() def index(): grid = SQLFORM.grid(db.thing, inks=[lambda row: A('on' if row.active else 'off', _class='btn', _id='t%i'%row.id, target='t%i'%row.id, callback=URL('activate',args=row.id))]) return dict(grid=grid) @auth.requires_login() def activate(): if request.env.request_method=='POST': thing = db.thing(request.args(0,cast=int)) thing.update_record(active=not thing.active) return 'on' if thing.active else 'off' It makes Ajax buttons which toggle on/off the value of thing.active field for each row. -- --- 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: Book 5th edition out
I like the presentation style of one vs the other (side by side), thinking that if the right side is the form to enter target translation. just curious how people do the translation for web2py book, I might be able to help english chinese On Thursday, March 7, 2013 10:30:56 AM UTC-5, Niphlod wrote: Sorry, but I didn't get what you need : are you saying that you'd need the same thing, e.g., for the spanish version ? Are you basing your translation on a translation of the original ? e.g. english -- spanish -- japanese On Thursday, March 7, 2013 3:58:26 PM UTC+1, wwwgong wrote: Thanks, your little app may be customized for translation, where to see the source code? On Wednesday, March 6, 2013 7:27:34 PM UTC-5, Alan Etkin wrote: kindly hosted by github. http://niphlod.github.com/diffbook/ Many thanks! -- --- 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: The Great Web Framework Shootout
Please share the benchmark results when avail -- --- 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 is moving
packaged my local copy at http://dl.dropbox.com/u/54552252/web2py.app.w2p_book.w2p in case you want to import it On Sunday, March 3, 2013 8:57:17 AM UTC-5, Niphlod wrote: download the ziphttps://github.com/mdipierro/web2py-book/archive/master.zip, decompress in applications/, choose an application name without - in it (so, web2py_book vs web2py-book). On Sunday, March 3, 2013 7:02:58 AM UTC+1, Monte Milanuk wrote: So... this is supposed to be installable as an app within web2py, right? It's not a w2p file, so I can't install it directly as a package file. I tried renaming the original zip file I downloaded to a .w2p extension, nada. Tried extracting and then repackaging as a .tar.gz file... nada. Tried renaming *that* as a .w2p file... which finally installed, but as soon as I tried opening the application from web2py, I got a page saying invalid controller (default/index) Trying to install directly from git appears to require 'gitpython', which I installed (via git), but web2py still complains about it being 'not available or incompatible version' (running python 2.7.3, git 1.7.10, web2py 2.3.2, on Ubuntu 12.10). Any other suggestions? -- --- 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 is moving
web2py is unavail because 502 Bad Gateway -- nginx/1.2.6 On Thursday, February 28, 2013 6:40:22 PM UTC-5, Massimo Di Pierro wrote: web2py.com is moving to pythonanywhere.com. There may be disruptions but we hope not. -- --- 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 is moving
If you choose 1 lang, the size is much smaller On Saturday, March 2, 2013 11:01:27 PM UTC-5, LightDot wrote: The book is too big to be included in every download, IMHO, it's about 120 MB or so. The link... well, github - search - web2py book ;) Regards, Ales On Sunday, March 3, 2013 2:22:40 AM UTC+1, Monte Milanuk wrote: Could you provide a link? I would very much like to work offline at times, and the PDF is falling further and further behind. Actually, I wish the current version of the online html book would just be included in the download as a webapp by default. On Friday, March 1, 2013 5:34:50 PM UTC-8, rh wrote: On Fri, 1 Mar 2013 15:10:54 -0800 (PST) John Ho john@gmail.com wrote: The link to the online engish book is broken (Invalid request). I don't know if you're reporting it down because you need it now or just to report it's down. FWIW you can download the book and it is a web2py app and you can view it locally. Good for planes, trains and automobiles too. The book is on github. -- --- 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 is moving
I installed 3 languages (ENU, CHN DEU) locally, total size = 30MB so it is about 10MB/per lang On Saturday, March 2, 2013 11:53:07 PM UTC-5, wwwgong wrote: If you choose 1 lang, the size is much smaller On Saturday, March 2, 2013 11:01:27 PM UTC-5, LightDot wrote: The book is too big to be included in every download, IMHO, it's about 120 MB or so. The link... well, github - search - web2py book ;) Regards, Ales On Sunday, March 3, 2013 2:22:40 AM UTC+1, Monte Milanuk wrote: Could you provide a link? I would very much like to work offline at times, and the PDF is falling further and further behind. Actually, I wish the current version of the online html book would just be included in the download as a webapp by default. On Friday, March 1, 2013 5:34:50 PM UTC-8, rh wrote: On Fri, 1 Mar 2013 15:10:54 -0800 (PST) John Ho john@gmail.com wrote: The link to the online engish book is broken (Invalid request). I don't know if you're reporting it down because you need it now or just to report it's down. FWIW you can download the book and it is a web2py app and you can view it locally. Good for planes, trains and automobiles too. The book is on github. -- --- 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: I need a double entry accounting software ....
I have CRM background, very interested in ERPLibre especially using web2py. Thanks for sharing On Saturday, February 23, 2013 5:24:51 PM UTC-5, Massimo Di Pierro wrote: I had not seen this before. ERPLibre is impressive! Massimo On Saturday, 23 February 2013 12:58:35 UTC-6, Alan Etkin wrote: I cannot load the page. If you have other links to docs about how ERP works I could use them. Mind that ERPlibre is still a work-in-progress. A working first alpha implementation is although available for download at http://code.google.com/p/erplibre/downloads/list It ships with web2py because it uses it for anything but the desktop GUI (wx). English docs (and the wiki itself) is not as comprehensive as it should be. But you may want to check this: http://code.google.com/p/erplibre/w/list http://code.google.com/p/erplibre/wiki/Screenshots 1) The account structure is a tree: Assets *BankAccount **Account0001 The tentative accounting model of ERPlibre is code.google.com/p/erplibre/source/browse/modules/db_erplibre.py It was ported from the proprietary Gestión Pyme project (Mariano Reingart). It doesn't support multiple currency so far but I belive it could be easily added. The accounting model is very simple. It's not intended as a mid-large business accounting tool. So I'm afraid I cannot help with the pacioli model. Even there's no bank account model object yet, although we plan to support them. It uses banks as a reference for billing/payment checks. You can still browse the project code in case something can be applied also to pacioli. A db instance stores companies. Installation sets one of them as the system host (for billing, reports, etc). A company/firm has a set of linked accounting tables such as accounting period, journal entry, entry, account. Account is the cathegory set for storing accounting movements (entries). The model defines banks, but different bank account management (reports, etc) is not implemented. 3) Basically the problem as above but related to inventory. Inventory stuff are assets. ERPlibre stock and accounting models are not linked. Booking is updated on sales billls or manual movement entries (for adjusting or updating cash, buys, ...) For the complete model check: http://code.google.com/p/erplibre/source/browse/modules/db_erplibre.py -- --- 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 fails to show consistent behavior between parent and child tables
Jim Thanks, Your suggestion worked. It would be nice if one does not have to duplicate the code, any idea how parent can inherit child's behavior? W On Thursday, February 21, 2013 6:32:58 PM UTC-5, Jim S wrote: Try moving your db.person.url.represent = lambda url, row: A(url,_href=url) into your list_organizations method. I don't believe your list_people method isn't utilized in the screen shots provided. -Jim On Thursday, February 21, 2013 5:23:27 PM UTC-6, wwwgong wrote: using web2py v2.3.2, I found smartgrid shows inconsistent behavior between parent and child tables. To illustrate, #model: parent: org, child: person db.define_table('organization', Field('name'), Field('url',label='URL') ) db.define_table('person', Field('name'), Field('url',label='URL'), Field('organization','reference organization'), ) #controller: both tables have a URL field def list_organizations(): db.organization.url.represent = lambda url, row: A(url,_href=url) form = SQLFORM.smartgrid(db.organization) return dict(form=form) def list_persons(): db.person.url.represent = lambda url, row: A(url,_href=url) form = SQLFORM.smartgrid(db.person) return dict(form=form) Issue: field organization.url shows hyperlink, but field person.url does not. see attached screenshot I start to read web2py source code, and can help with some guidance. Thanks, Wen -- --- 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: smartgrid fails to show consistent behavior between parent and child tables
yes, that is a better solution and works! on a different topic, I notice you have many posts on smartgrid, I like to use smartgrid too, but do you agree that documentation or example usage on it is somewhat lacking? Thanks, W On Friday, February 22, 2013 11:37:58 AM UTC-5, Jim S wrote: Then you could put the code in your model. Would be global then On Feb 22, 2013 9:04 AM, wwwgong wen.g...@gmail.com javascript: wrote: Jim Thanks, Your suggestion worked. It would be nice if one does not have to duplicate the code, any idea how parent can inherit child's behavior? W On Thursday, February 21, 2013 6:32:58 PM UTC-5, Jim S wrote: Try moving your db.person.url.represent = lambda url, row: A(url,_href=url) into your list_organizations method. I don't believe your list_people method isn't utilized in the screen shots provided. -Jim On Thursday, February 21, 2013 5:23:27 PM UTC-6, wwwgong wrote: using web2py v2.3.2, I found smartgrid shows inconsistent behavior between parent and child tables. To illustrate, #model: parent: org, child: person db.define_table('organization'**, Field('name'), Field('url',label='URL') ) db.define_table('person', Field('name'), Field('url',label='URL'), Field('organization','**reference organization'), ) #controller: both tables have a URL field def list_organizations(): db.organization.url.represent = lambda url, row: A(url,_href=url) form = SQLFORM.smartgrid(db.**organization) return dict(form=form) def list_persons(): db.person.url.represent = lambda url, row: A(url,_href=url) form = SQLFORM.smartgrid(db.person) return dict(form=form) Issue: field organization.url shows hyperlink, but field person.url does not. see attached screenshot I start to read web2py source code, and can help with some guidance. Thanks, Wen -- --- 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+un...@googlegroups.com javascript:. 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.
Re: [web2py] Re: smartgrid fails to show consistent behavior between parent and child tables
I started to read sqlhtml.py too since yesterday yes, this group is very supportive, I am going to stick with web2py for a long while Thanks for your help Wen On Friday, February 22, 2013 12:09:20 PM UTC-5, Jim S wrote: I've been working with the smartgrid since Massimo created it. The way I learned most about it was to open up sqlhtml.py in my editor and look through the source, primarily at the parameters that you can pass to it. There is a great deal of capability and flexibility build into it. So, I agree, not much documentation out there, but the source has all the answers. Also, I've found this group to be extremely helpful whenever you have questions... -Jim On Fri, Feb 22, 2013 at 10:49 AM, wwwgong wen.g...@gmail.comjavascript: wrote: yes, that is a better solution and works! on a different topic, I notice you have many posts on smartgrid, I like to use smartgrid too, but do you agree that documentation or example usage on it is somewhat lacking? Thanks, W On Friday, February 22, 2013 11:37:58 AM UTC-5, Jim S wrote: Then you could put the code in your model. Would be global then On Feb 22, 2013 9:04 AM, wwwgong wen.g...@gmail.com wrote: Jim Thanks, Your suggestion worked. It would be nice if one does not have to duplicate the code, any idea how parent can inherit child's behavior? W On Thursday, February 21, 2013 6:32:58 PM UTC-5, Jim S wrote: Try moving your db.person.url.represent = lambda url, row: A(url,_href=url) into your list_organizations method. I don't believe your list_people method isn't utilized in the screen shots provided. -Jim On Thursday, February 21, 2013 5:23:27 PM UTC-6, wwwgong wrote: using web2py v2.3.2, I found smartgrid shows inconsistent behavior between parent and child tables. To illustrate, #model: parent: org, child: person db.define_table('organization', Field('name'), Field('url',label='URL') ) db.define_table('person', Field('name'), Field('url',label='URL'), Field('organization','**referenc**e organization'), ) #controller: both tables have a URL field def list_organizations(): db.organization.url.represent = lambda url, row: A(url,_href=url) form = SQLFORM.smartgrid(db.**organizat**ion) return dict(form=form) def list_persons(): db.person.url.represent = lambda url, row: A(url,_href=url) form = SQLFORM.smartgrid(db.person) return dict(form=form) Issue: field organization.url shows hyperlink, but field person.url does not. see attached screenshot I start to read web2py source code, and can help with some guidance. Thanks, Wen -- --- 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+un...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://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+un...@googlegroups.com javascript:. 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] smartgrid breadcrums not displaying Id when details=False
found from sqlhtml.py that smartgrid breadcrums displays Row Id only if details=True: if kwargs.get('details', True): breadcrumbs.append( LI(A(name, _class=trap_class(), _href=url(args=['view', referee, id])), SPAN(divider, _class='divider'), _class='w2p_grid_breadcrumb_elem')) This is not obvious to me, Can someone shed light on this logic? Thanks, W -- --- 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: Sort order for related table grids in SQLFORM.smartgrid
Smartgrid is nice, but not well documented, how can we improve this? On Thursday, December 22, 2011 1:23:04 PM UTC-5, Adi wrote: *+1* -- --- 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] Is web2py.com down today?
cannot access web2py.com today, any clue? -- --- 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] field of password type is displayed as cleartext in smartgrid form
Got it, Thx -- --- 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] field of password type is displayed as cleartext in smartgrid form
Hi, I am using web2py v2.3.2 and see that field of password type is displayed as cleartext in smartgrid form (screenshot is attached). Is this design behavior or a bug? but password is hidden in edit view -- --- 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. attachment: w2p-password.jpg
Re: [web2py] ipython is your friend!
I like IPython On Sunday, February 10, 2013 6:20:30 AM UTC-5, Ramos wrote: +1 for a VIDEO of this... 2013/2/9 JimK jke...@gmail.com javascript: One of the nice things about python modules that are not c-compiled is the fact that you can read the source code. The bad part is that the source code is not always easy to find. This is where ipython comes in. IPython is an alternative to the regular python interpreter which offers a bunch of niceties. This interpreter is supported by web2py out of the box; just install ipython (pip install ipython) and start web2py at the command prompt (python web2py.py -S appname -M). This will load the web2py environment for your application and it's models using the ipython interpreter. I won't go through them all, but rather just a couple that really come in handy for me during web2py development. Let's say you want to see the doc string for SQLFORM: In [2]: form = SQLFORM?return ipython display a scrollable doc string (type 'q' to exit the doc string viewer) Now you want to see the source code of the SQLFORM class: In [3]: form = SQLFORM??return ipython now shows the entire SQLFORM class Let's say you want to just see all of the methods that SQLFORM has to offer: In [5]: SQLFORM.tab SQLFORM.AUTOTYPES SQLFORM.assert_status SQLFORM.grid SQLFORM.search_menu SQLFORM.FIELDKEY_DELETE_RECORDSQLFORM.build_query SQLFORM.hidden_fields SQLFORM.sibling SQLFORM.FIELDNAME_REQUEST_DELETE SQLFORM.confirm SQLFORM.insertSQLFORM.siblings SQLFORM.ID_LABEL_SUFFIX SQLFORM.createform SQLFORM.mro SQLFORM.smartdictform SQLFORM.ID_ROW_SUFFIX SQLFORM.dictform SQLFORM.process SQLFORM.smartgrid SQLFORM.REDIRECT_JS SQLFORM.element SQLFORM.regex_attrSQLFORM.tag SQLFORM.accepts SQLFORM.elements SQLFORM.regex_class SQLFORM.update SQLFORM.add_buttonSQLFORM.factory SQLFORM.regex_id SQLFORM.validate SQLFORM.add_class SQLFORM.flatten SQLFORM.regex_tag SQLFORM.widgets SQLFORM.appendSQLFORM.formstyles SQLFORM.remove_class SQLFORM.xml Finally, if you want to dig into any of those methods, like smartgrid: In [6]: SQLFORM.smartgrid?return or In [7]: SQLFORM.smartgrid??return and since the SQLFORM code is well documented and the argument names are descriptive, you should be able to figure out more problems on your own. This is just a taste of what you can do with ipython. It can also display more detailed traceback messages, run os-level commands without exiting the interpreter, debug code, etc. I hope this helps a bit! Jim -- --- 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+un...@googlegroups.com javascript:. 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] Re: looking for volunteers to help proof-read book 5th ed.
Massimo, Do you plan to add a section to briefly highlight the major revisions when the new edition of web2py book comes online? Thanks, Wen On Sunday, January 20, 2013 6:52:02 PM UTC-5, Massimo Di Pierro wrote: I am looking for help proofreading the final version of the book. It is almost done up to a final touch. The attached file contains the changes between the 4th edition and 5th edition (only the new text). It would be great is some native english speaker could be me proof-read the changes. If you can help please edit the text in place with a text editor, without adding line breaks or extra spaces so I can diff the corrections. The first two people who volunteer to help and can proof-read the attached file by Saturday, will receive a free copy of the printed book as soon as it is done. Massimo -- --- 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: wiki now partially documented
Thanks for auth.wiki doc --
[web2py] Re: auth.wiki deployment issue
Hi, Alan, following your recipe: http://www.web2pyslices.com/slice/show/1565/wikifying-web2py-apps I got '401 UNAUTHORIZED' when accessing /mywiki/default/wiki/_editmedia/index I am using 2.3.2 stable on localhost, tried the same at pythonanywhere.com same error --
[web2py] Re: auth.wiki deployment issue
the group name shipped with 2.3.2 is 'wiki_editor', I changed it to 'wiki-editor' I also add 'wiki-author' and assign both to myself. Now I can add page and media --
Re: [web2py] how to cleanse field value
Thank you! On Wednesday, December 19, 2012 7:04:03 PM UTC-5, Massimo Di Pierro wrote: Here is a custom validator that replaces '-' with '_' class MyValidator(obejct): def __call__(self,value): return (value.replace('-','_'), None) Field(..., requires=MyValidator()...) On Wednesday, 19 December 2012 16:54:21 UTC-6, wwwgong wrote: I thought validator only validates, can you show me how to update field with the sanitized value. Thanks, On Wednesday, December 19, 2012 9:57:48 AM UTC-5, viniciusban wrote: Try a custom validator to sanitize your description field. On Wed, Dec 19, 2012 at 12:06 PM, wwwgong wen.g...@gmail.com wrote: Hi, I like to store youtube videos into a table: db.define_table('youtube', Field('code'), Field('description') ) def youtube_repr(code,width=400,height=250): return XML( object width=%(width)s height=%(height)s param name=movie value=http://www.youtube.com/v/%(code)shl=en_USfs=1/param param name=allowFullScreen value=true/param param name=allowscriptaccess value=always/param embed src=http://www.youtube.com/v/%(code)shl=en_USfs=1 type=application/x-shockwave-flash allowscriptaccess=always allowfullscreen=true width=%(width)s height=%(height)s/embed /object % dict(code=code, width=width, height=height) ) db.youtube.code.represent = youtube_repr with this controller: def youtube_video(): form = SQLFORM.grid(db.youtube) return dict(form=form) If the description field contains double quote char {}, it will messes up, see screenshot at http://dl.dropbox.com/u/54552252/cleanse-web2py-field-value.jpg I know web2py offers custom validator to detect special char in Form field, but is it possible to attach a pre-process function at DAL layer to cleanse field value before db operation? Something like: db.youtube.description.preprocess = cleanse_special_char where cleanse_special_char is a function to cleanse db.youtube.description field value Can someone offer a solution or workaround? Thanks, Wen -- --
Re: [web2py][outsource] Need a plugin that integrate jsTree or other tree plugin with closure table app
I am interested in tree widget too, have you evaluated 1) http://dev.s-cubism.com/plugin_jstree 2) http://dev.s-cubism.com/plugin_mptt which is based on Nested Set W On Thursday, September 20, 2012 3:21:14 PM UTC-4, Richard wrote: 1) Users are defining information into simple form where is will be easier to allow them to create hierarchy... About nestedSortable as long as it is well supported by the owner of the project no problem about the js plugin used. 2) Bill Karwin lecture convinces me that it was the cleaner way of doing thing. Also, my data are already structured that way. The relation between node are not going to move that much (not move at all once establish), it may happen that when node will be created there will be mistake that will need to be corrected, but then no change will happen (that may have no consequence on the programmation since the moving of subnode are be required anyway). Thanks Richard On Thu, Sep 20, 2012 at 2:00 PM, Vasile Ermicioi elf...@gmail.comjavascript: wrote: may I ask a few questions 1) (a suggestion) why do you need multiselect if jstree already support drag drop? http://www.jstree.com/documentation/dnd# and I didn't see a better way to manipulate hierarchical data than what it offers an alternative is nestedSortable http://mjsarfatti.com/sandbox/nestedSortable/ but when you want to move a node with a lot of children it has poor performance 2) (interested because I did research some time ago on that field) why did you chose closure data model? -- --
[web2py] how to cleanse field value
Hi, I like to store youtube videos into a table: db.define_table('youtube', Field('code'), Field('description') ) def youtube_repr(code,width=400,height=250): return XML( object width=%(width)s height=%(height)s param name=movie value=http://www.youtube.com/v/%(code)shl=en_USfs=1/param param name=allowFullScreen value=true/param param name=allowscriptaccess value=always/param embed src=http://www.youtube.com/v/%(code)shl=en_USfs=1 type=application/x-shockwave-flash allowscriptaccess=always allowfullscreen=true width=%(width)s height=%(height)s/embed /object % dict(code=code, width=width, height=height) ) db.youtube.code.represent = youtube_repr with this controller: def youtube_video(): form = SQLFORM.grid(db.youtube) return dict(form=form) If the description field contains double quote char {}, it will messes up, see screenshot at http://dl.dropbox.com/u/54552252/cleanse-web2py-field-value.jpg I know web2py offers custom validator to detect special char in Form field, but is it possible to attach a pre-process function at DAL layer to cleanse field value before db operation? Something like: db.youtube.description.preprocess = cleanse_special_char where cleanse_special_char is a function to cleanse db.youtube.description field value Can someone offer a solution or workaround? Thanks, Wen --
Re: [web2py] how to cleanse field value
I thought validator only validates, can you show me how to update field with the sanitized value. Thanks, On Wednesday, December 19, 2012 9:57:48 AM UTC-5, viniciusban wrote: Try a custom validator to sanitize your description field. On Wed, Dec 19, 2012 at 12:06 PM, wwwgong wen.g...@gmail.comjavascript: wrote: Hi, I like to store youtube videos into a table: db.define_table('youtube', Field('code'), Field('description') ) def youtube_repr(code,width=400,height=250): return XML( object width=%(width)s height=%(height)s param name=movie value=http://www.youtube.com/v/%(code)shl=en_USfs=1/param param name=allowFullScreen value=true/param param name=allowscriptaccess value=always/param embed src=http://www.youtube.com/v/%(code)shl=en_USfs=1 type=application/x-shockwave-flash allowscriptaccess=always allowfullscreen=true width=%(width)s height=%(height)s/embed /object % dict(code=code, width=width, height=height) ) db.youtube.code.represent = youtube_repr with this controller: def youtube_video(): form = SQLFORM.grid(db.youtube) return dict(form=form) If the description field contains double quote char {}, it will messes up, see screenshot at http://dl.dropbox.com/u/54552252/cleanse-web2py-field-value.jpg I know web2py offers custom validator to detect special char in Form field, but is it possible to attach a pre-process function at DAL layer to cleanse field value before db operation? Something like: db.youtube.description.preprocess = cleanse_special_char where cleanse_special_char is a function to cleanse db.youtube.description field value Can someone offer a solution or workaround? Thanks, Wen -- --
[web2py] Re: fail to use web2py in IPython Notebook
Massimo, Thanks for your quick reply. For most part, web2py worked with IPython Notebook like DAL, which is pretty good. My interest is to to reuse web2py for managing notebooks without developing Tornado apps myself as I am new to python and web2py. W. On Sunday, December 16, 2012 10:13:16 PM UTC-5, Massimo Di Pierro wrote: Unfortunately I am not sure you can run web2py with Ipython notebook. The reason is that the notebook is a web interface and the statements are executed server side. The notebook server may execute the statements in different threads (I am not sure but from the tracebacks that is what it looks like). The web2py modules assume no data is shared among threads since one tread serves one request at the time. I would need to understand better the notebook concurrency model before this can be addressed. Massimo On Sunday, 16 December 2012 18:35:06 UTC-6, wwwgong wrote: I have watched video at https://vimeo.com/21185623 and try to use web2py inside IPython Notebook, but run into the following error: form = SQLFORM(db.ipynotebooks) ---AttributeError Traceback (most recent call last)ipython-input-36-c6b1cb76b770 in module() 1 form = SQLFORM(db.ipynotebooks) D:\web2py_git\gluon\sqlhtml.pyc in __init__(self, table, record, deletable, linkto, upload, fields, labels, col3, submit_button, delete_label, showid, readonly, comments, keepopts, ignore_rw, record_id, formstyle, buttons, separator, **attributes)911linkto=URL(f='table/db/') 912 -- 913 T = current.T914 915 self.ignore_rw = ignore_rw AttributeError: 'thread._local' object has no attribute 'T' I have created a gist at http://nbviewer.ipython.org/4314583/ Thanks, W --
Re: [web2py] raspberry pi
Now I see it in the source release. Thanks, On Sunday, December 16, 2012 10:02:53 PM UTC-5, Massimo Di Pierro wrote: anyserver.py ships with web2py in the main folder. Run it with -h for info. ;-) On Sunday, 16 December 2012 16:57:12 UTC-6, wwwgong wrote: Hi Massimo, The ease of running web2py/python/RaspberryPi out of box speaks loudly about the quality and lightweightness of the whole stack. I watched your talk web2py: Web Development Should be Easyhttps://www.youtube.com/watch?v=iMUX9NdN8YE today and agree that the key to attract young programmer is to make it as easy as playing a game. Does one need to teach kids how to play game? On a seperate subject, I watched your video on web2py plays with tornado, cherrypy, paste, mako, and the regular Python shell https://vimeo.com/21185623? can you share anyserver.py script? I don't quite understand how to make web2py and tornado runs together. I am interested in running IPython Notebook together with web2py. Thanks, W On Saturday, December 15, 2012 9:24:40 AM UTC-5, Massimo Di Pierro wrote: This is good to know. I should get one. On Friday, 14 December 2012 20:44:48 UTC-6, wwwgong wrote: yes, I bought a 512MB Raspberry Pi for $35 as a gift to my kid 2 weeks ago. In less than 5 mins, I am able to run web2py (v2.3.1) on this tiny and cheap platform. installed 2 of my apps, they run a bit slow, but smoothly without error. Web2py + Python + RaspberryPi is a cool toy. I am going to show it off to my 6 grade class. Cheers, W On Friday, August 10, 2012 3:28:57 PM UTC-4, aapaap wrote: I just did it, within 5 minutes. Python is already installed on the Raspberry-pi. - download the sources to the Raspberry - unpack the zip file - open a terminal window and go to the directory where it is unpacked - python web2py.py that's all. cheers, Stef On 13-03-2012 11:04, Ant�nio Ramos wrote: it would be nice to be able to install web2py in raspberry pi http://www.raspberrypi.org/ --
Re: [web2py] raspberry pi
Hi Massimo, The ease of running web2py/python/RaspberryPi out of box speaks loudly about the quality and lightweightness of the whole stack. I watched your talk web2py: Web Development Should be Easyhttps://www.youtube.com/watch?v=iMUX9NdN8YE today and agree that the key to attract young programmer is to make it as easy as playing a game. Does one need to teach kids how to play game? On a seperate subject, I watched your video on web2py plays with tornado, cherrypy, paste, mako, and the regular Python shell https://vimeo.com/21185623? can you share anyserver.py script? I don't quite understand how to make web2py and tornado runs together. I am interested in running IPython Notebook together with web2py. Thanks, W On Saturday, December 15, 2012 9:24:40 AM UTC-5, Massimo Di Pierro wrote: This is good to know. I should get one. On Friday, 14 December 2012 20:44:48 UTC-6, wwwgong wrote: yes, I bought a 512MB Raspberry Pi for $35 as a gift to my kid 2 weeks ago. In less than 5 mins, I am able to run web2py (v2.3.1) on this tiny and cheap platform. installed 2 of my apps, they run a bit slow, but smoothly without error. Web2py + Python + RaspberryPi is a cool toy. I am going to show it off to my 6 grade class. Cheers, W On Friday, August 10, 2012 3:28:57 PM UTC-4, aapaap wrote: I just did it, within 5 minutes. Python is already installed on the Raspberry-pi. - download the sources to the Raspberry - unpack the zip file - open a terminal window and go to the directory where it is unpacked - python web2py.py that's all. cheers, Stef On 13-03-2012 11:04, Ant�nio Ramos wrote: it would be nice to be able to install web2py in raspberry pi http://www.raspberrypi.org/ --
[web2py] fail to use web2py in IPython Notebook
I have watched video at https://vimeo.com/21185623 and try to use web2py inside IPython Notebook, but run into the following error: form = SQLFORM(db.ipynotebooks) ---AttributeError Traceback (most recent call last)ipython-input-36-c6b1cb76b770 in module() 1 form = SQLFORM(db.ipynotebooks) D:\web2py_git\gluon\sqlhtml.pyc in __init__(self, table, record, deletable, linkto, upload, fields, labels, col3, submit_button, delete_label, showid, readonly, comments, keepopts, ignore_rw, record_id, formstyle, buttons, separator, **attributes)911linkto=URL(f='table/db/')912 -- 913 T = current.T914 915 self.ignore_rw = ignore_rw AttributeError: 'thread._local' object has no attribute 'T' I have created a gist at http://nbviewer.ipython.org/4314583/ Thanks, W --
Re: [web2py] raspberry pi
yes, I bought a 512MB Raspberry Pi for $35 as a gift to my kid 2 weeks ago. In less than 5 mins, I am able to run web2py (v2.3.1) on this tiny and cheap platform. installed 2 of my apps, they run a bit slow, but smoothly without error. Web2py + Python + RaspberryPi is a cool toy. I am going to show it off to my 6 grade class. Cheers, W On Friday, August 10, 2012 3:28:57 PM UTC-4, aapaap wrote: I just did it, within 5 minutes. Python is already installed on the Raspberry-pi. - download the sources to the Raspberry - unpack the zip file - open a terminal window and go to the directory where it is unpacked - python web2py.py that's all. cheers, Stef On 13-03-2012 11:04, Ant�nio Ramos wrote: it would be nice to be able to install web2py in raspberry pi http://www.raspberrypi.org/ --
[web2py] Issue 1211: form.process input parameter keepvalues=True not working
I just raised Issue 1211 with more details. In short, keepvalues=True input seems to be ignored when used with onvalidation. but form.process(keepvalues=True) is ok. Thanks, Wen def insert_numbers(): form = SQLFORM(db.numbers) if form.process(keepvalues=True,onvalidation=my_form_processing).accepted: session.flash = 'record inserted' redirect(URL()) return dict(form=form) --
[web2py] how to pre-default an upload field type
Hi, I like to build a small web2py app to manage documents on my computer. e.g. db.define_table('docs', Field('filename'), Field('filetype'), Field('category'), Field('description'), Field('filepath','upload') ); If I like to create a new document,e.g. 'test.doc', how can web2py pre-default an empty .doc file into uploads folder before I would later add content to file in OS. In above table, a new record should be created with : filename='test', filetype='doc', category='test', description='test', filepath='test-xx.doc' Thanks for your help Wen --
Re: [web2py] Re: [Announcement] web2py powered app Vocabilis.NET
Thanks for sharing your web site. I am interested in using it to teach Chinese. It would be good if you can post a youtube video on how to your site. Wen On Friday, August 31, 2012 8:52:01 AM UTC-4, Alexei Vinidiktov wrote: That would be great! :) On Fri, Aug 31, 2012 at 3:04 AM, Massimo Di Pierro massimo@gmail.comjavascript: wrote: My wife teaches Italian. Perhaps I get finally get her to use web2py. ;-) On Thursday, 30 August 2012 09:53:56 UTC-5, Alexei Vinidiktov wrote: Hi, I'm glad to announce the launch of my second web2py powered web application www.vocabilis.net. It's a flashcard vocabulary builder for language learners. On the front end I use Flex and on the back end I use web2py. To see the app in action you'll need to register on the site. Registration doesn't require email confirmation at the moment. I'd like to thank the web2py community for all the help I've gotten working on Vocabilis.NET. Massimo and all the contributors, thank you for creating such an indispensable tool! Thanks, guys! -- Alexei Vinidiktov -- -- Alexei Vinidiktov --
[web2py] Re: web2py 2.0.5 is out
Congratulations and Many Thanks! The new web2py is my best birthday gift. Cheers! On Friday, August 31, 2012 5:59:43 PM UTC-4, Massimo Di Pierro wrote: web2py 2.0.5 is out. All known backward compatibility issues should be fixed but continue testing... thank you for your patience. massimo On Wednesday, 29 August 2012 22:41:34 UTC-5, Massimo Di Pierro wrote: After 5 months. It is done. This is the most waited and the most feature-packed release. I am sure we'll find some corners that need to be ironed but it is considerably better than 1.99.7. It adds lot of new features and improves many existing ones: - 57,000 new lines of code and closed 279 issues since 1.99.7. - Retrieving data from DB should be faster, in particular select(cacheable=True) - Has a new scheduler, a built-in wiki, new language and pluralization system, better markmin with oembed support and better scaffolding app, increased security. - Lots of experimental features including GIS support, mongodb support, built-in auth.wiki(), and more. Should be 100% backward compatible. If you run into any issue let us know ASAP. I personally want to thank the major contributors to this release (in alphabetic order) Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, Iceberg, Jonathan, Marc, Mariano, Marin, Martin, Mark, Michael, Michele, Niphlod, Patrick, Vladyslav, They spend many nights testing, coding, debugging at a very fast pace. Many many people have contributed. If your contribution has not been properly acknowledged please let us know ASAP. It is probably an oversight. Massimo Detailed changelog === ## 2.00.2 ### DAL Improvements - Support for DAL(lazy_tables=True) and db.define_table(on_define=lambda table:), thanks Jonathan - db(...).select(cacheable=True) make select 30% faster - db(...).select(cache=(cache.ram,3600)) now caches parsed data 100x faster - db(...).count(cache=(cache.ram,3600)) now supported - MongoDB support in DAL (experimental), thanks Mark Breedveld - geodal and spatialite, thanks Denes and Fran (experimental) - db.mytable._before_insert, _after_insert, _before_update, _after_update, _before_delete. _after_delete (list of callbacks) - db(...).update_naive(...) same as update but ignores table._before_update and table._after_update - DAL BIGINT support and DAL(...,bigint_id=True) - IS_IN_DB(..., distinct=True) - new syntax: db.mytable.insert(myuploadfield=open()), thank you Iceberg - db(...).select(db.mytable.myfield.count(distinct=True)) - db(db.a)._update(name=db(db.b.a==db.a.id).nested_select(db.b.id)) - db.mytable.myfield.filter_in, filter_out - db.mytable._enable_record_versioning(db) adds versioning to this table - teradata adapter, thanks Andrew Willimott - experimental Sybase Adapter - added db.table.field.avg() - Support for Google App Engine projections, thanks Christian - Field(... 'upload', default=path) now accepts a path to a local file as default value, if user does not upload a file. Relative path looks inside current application folder, thanks Marin - executesql(...,fields=,columns=) allows parsing of results in Rows, thanks Anthony ### Auth improvements - auth.enable_record_versioning(db) adds full versioning to all tables - @auth.requires_login(otherwise=URL(...)) - auth supports salt and compatible with third party data, thanks Dave Stoll - CRYPT now defaults to pbkdf2(1000,20,sha1) - Built-in wiki with menu, tags, search, media, permissions. def index: return auth.wiki() - auth.settings.everybody_group_id - allow storage of uploads on any PyFileSystem (including amazon) ### Form improvements - FORM.confirm('Are you sure?',{'Back':URL(...)}) - SQLFORM.smartdictform(dict) - form.add_button(value,link) - SQLFORM.grid(groupby='...') - fixed security issue with SQLFORM.grid and SQLFORM.smartgrid - more export options in SQLFORM.grid and SQLFORM.smartgrid (html, xml, csv, ...) ### Admin improvements - new admin pages: manage_students, bulk_regsiter, and progress reports - increased security in admin against CSRF - experimental Git integration - experimental OpenShift deployment - multi-language pluralization engine - ace text web editor in admin - Ukrainian translations, thanks Vladyslav Kozlovskyy - Romanian translation for welcome, thanks ionel - support for mercurial 2.6, thanks Vlad ### Scheduler Improvements (thanks to niphlod, ykessler, dhx, toomim) - web2py.py -K myapp -X starts the myapp scheduler alongside the webserver - tasks are marked EXPIRED (if stop_time passed) - functions with no result don't end up in scheduler_run - more options: web2py.py -E -b -L - scheduler can now handle 10k tasks with 20 concurrent workers and with no issues - new params: tasks can be found in the environment (no need to define the tasks parameter) max_empty_runs kills the workers automatically if no new tasks are found in queue
[web2py] Re: HersPOS - New Version released 0.03 Web2py + Qooxdoo POS
I went back to web2py book and found section on using json directly. I guess jsonrpc is more for web service, for internal front/back end communication, it is simply better to use json directly. Strongly agree with you on Qooxdoo, The look-and-feel of Qooxdoo very professional, I have not found others close to it. I tried pyjamas and todoapp, it may be good for prototype, but does not like its UI and very limited in widgets. On Nov 1, 3:49 am, Phyo Arkar phyo.arkarl...@gmail.com wrote: for 5) I will add - adding/deleting rows and truncating tables. Stay tuned. 1) I am using directly Json as I haven't really look into JSONRPC of qooxdoo yet. In web2py every request ends with .json return in JSON Serialized result. 2) /HersPOS/default/insert_items.json is the actual request url , the return result is actually JSON 3) Yes they dont do anything yet, i will add login function and also Review page where you can filter by items. OK I will make annoucement on Qooxdoo mailing list too. After studying qooxdoo i am liking it a lot. even it's javascript is fully object oriented and not easy for starter , its really pays off after adapted to it ., main thing is you can really forget about HTML and CSS , jquery , jquery-ui , all other hack and slash libraries. Thanks a lot for trying HersPOS and please enjoy studying , modifying it to your needs. On 11/1/11, wwwgong wen.g.g...@gmail.com wrote: I installed it locally, gave app name=herspos, it worked It is great learning stuff for a newbie like me. I am able to do the following: 1) browse the Date tree, sales are filtered by date 2) add sales on 'Sales' tab 3) add product item on 'Item' tab 4) I used sqlite db 5) delete some sales using sqlite browser, this caused front end to freeze, refresh does not help, but restart the Herspos and see data refreshed Start reading your codes, I have 3 questions so far, 1) you are not using @service.jsonrpc decorator, but json protocal instead, is this documented anywhere? e.g. this.row_count_url = /HersPOS/default/total_rows.json; is this considered jsonrpc or something different? 2) how come for add button, you don't use json, but switch to Xhr var req = new qx.io.request.Xhr(/HersPOS/default/ insert_items.json?food_name= + food_name + price= + price + base_price= + base_price); 3) the buttons on toolbar are not doing anything, is it true? Have you made announcement on Qooxdoo forum yet? Personally, I think Qooxdoo has the best javascript UI toolkit, web2py is the simplest python web framework. Thank you for blazing a path. Wen On Oct 23, 8:53 am, Phyo Arkar phyo.arkarl...@gmail.com wrote: i also released w2p appliance , can you guys check it out if it works or not? Please note if you install w2p appliance application name needs to be changed toHersPOS(Case Sensitive) Thanks. Phyo. On 10/23/11, Phyo Arkar phyo.arkarl...@gmail.com wrote: Link :http://code.google.com/p/herspos Demo :http://herspos.appspot.com/HersPOS On 10/23/11, Phyo Arkar phyo.arkarl...@gmail.com wrote: New Features : -FIltering by date -Added tabs and seperated items tables / Sales table. -Demo avaliable on Gae , partially workling (No Sales Table working but Item table works). Due to no join avaliable , please suggest me a work around. Thanks Phyo.
[web2py] Re: JSONDecodeError: No JSON object could be decoded
I downloaded the latest web2py 1.99.2 followed web2py book on JSONRPC http://www.web2py.com/book/default/chapter/09#XMLRPC I am able to test jsonrpc service as below: from gluon.contrib.simplejsonrpc import ServerProxy URL = http://127.0.0.1:8100/myapp/default/call/jsonrpc; service = ServerProxy(URL, verbose=True) print service.add(1, 2) connect: (127.0.0.1, 8100) send: 'POST /myapp/default/call/jsonrpc HTTP/1.0\r\nHost: 127.0.0.1:8100\r\nUser -Agent: xmlrpclib.py/1.0.1 (by www.pythonware.com)\r\nContent-Type: application/ json\r\nContent-Length: 53\r\n\r\n' send: '{params: [1, 2], id: 2121494614, method: add}' reply: 'HTTP/1.1 200 OK\r\n' header: Expires: Mon, 31 Oct 2011 16:43:02 GMT header: Content-Type: application/json; charset=utf-8 header: X-Powered-By: web2py header: Pragma: no-cache header: Cache-Control: no-store, no-cache, must-revalidate, post- check=0, pre-ch eck=0 header: Date: Mon, 31 Oct 2011 16:43:02 GMT header: Server: Rocket 1.2.4 Python/2.5.4 header: Content-Length: 64 header: Connection: close body: '{error: null, version: 1.1, id: 2121494614, result: 3}' 3 In a nutshell: web2py is simply cool ! Wen On Oct 31, 12:05 am, Jonathan Lundell jlund...@pobox.com wrote: On Oct 30, 2011, at 9:00 PM, wwwgong wrote: ok, do you know a javascript client example? Thanks, Not offhand, no. But there's JSON-RPC documentation on the web that explains the protocol pretty well. And there's a client in the web2py contrib directory. On Oct 30, 12:42 am, Jonathan Lundell jlund...@pobox.com wrote: On Oct 29, 2011, at 9:36 PM, wwwgong wrote: Hi, add 2 functinos in myapp/controller/default.py @service.run def concat(a,b): return a+b @service.jsonrpc def concat2(a,b): return a+b test them using browser 1) http://127.0.0.1:8000/myapp/default/call/run/concat?a=hellob=world -- return 'helloworld' 2) http://127.0.0.1:8000/myapp/default/call/jsonrpc/concat2?a=hellob=world -- error Traceback (most recent call last): File gluon/restricted.py, line 192, in restricted File C:/web2py/applications/myapp/controllers/default.py, line 100, in module File gluon/globals.py, line 145, in lambda File C:/web2py/applications/myapp/controllers/default.py, line 80, in call File gluon/tools.py, line 3937, in __call__ File gluon/tools.py, line 3776, in serve_jsonrpc File gluon/contrib/simplejson/__init__.py, line 386, in loads File gluon/contrib/simplejson/decoder.py, line 403, in decode File gluon/contrib/simplejson/decoder.py, line 421, in raw_decode JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0) I am able to run todoApp from web2py book, so json module should be working, but why cannot I test jsonrpc this way in browser? The JSON-RPC service expects a JSON object (with specific content) as input. You're not providing it. Thanks, Wen
[web2py] Re: Web2py MVC and Qooxdoo
Phyo, I have downloaded your app at http://code.google.com/p/herspos/ Thanks a lot for sharing and will provide you with feedback after trying it out Wen
[web2py] Re: HersPOS - New Version released 0.03 Web2py + Qooxdoo POS
I installed it locally, gave app name=herspos, it worked It is great learning stuff for a newbie like me. I am able to do the following: 1) browse the Date tree, sales are filtered by date 2) add sales on 'Sales' tab 3) add product item on 'Item' tab 4) I used sqlite db 5) delete some sales using sqlite browser, this caused front end to freeze, refresh does not help, but restart the Herspos and see data refreshed Start reading your codes, I have 3 questions so far, 1) you are not using @service.jsonrpc decorator, but json protocal instead, is this documented anywhere? e.g. this.row_count_url = /HersPOS/default/total_rows.json; is this considered jsonrpc or something different? 2) how come for add button, you don't use json, but switch to Xhr var req = new qx.io.request.Xhr(/HersPOS/default/ insert_items.json?food_name= + food_name + price= + price + base_price= + base_price); 3) the buttons on toolbar are not doing anything, is it true? Have you made announcement on Qooxdoo forum yet? Personally, I think Qooxdoo has the best javascript UI toolkit, web2py is the simplest python web framework. Thank you for blazing a path. Wen On Oct 23, 8:53 am, Phyo Arkar phyo.arkarl...@gmail.com wrote: i also released w2p appliance , can you guys check it out if it works or not? Please note if you install w2p appliance application name needs to be changed toHersPOS(Case Sensitive) Thanks. Phyo. On 10/23/11, Phyo Arkar phyo.arkarl...@gmail.com wrote: Link :http://code.google.com/p/herspos Demo :http://herspos.appspot.com/HersPOS On 10/23/11, Phyo Arkar phyo.arkarl...@gmail.com wrote: New Features : -FIltering by date -Added tabs and seperated items tables / Sales table. -Demo avaliable on Gae , partially workling (No Sales Table working but Item table works). Due to no join avaliable , please suggest me a work around. Thanks Phyo.
[web2py] Re: Qooxdoo + Web2py Based AJAX POS system, Released!
I installed your pkg locally and run it in chrome, performance is very good On Oct 23, 8:48 am, Phyo Arkar phyo.arkarl...@gmail.com wrote: Hello Massimo! the demo is now avaliable at : http://herspos.appspot.com/HersPOS On GAE tho , joining tables not working so the main table , Sales table having error with Too many Tables selected. Can you show me how can i fix it? I am totally new to GAE. Thanks, Phyo. On 10/20/11, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Where can we see it in action? On Oct 19, 5:24 pm, Phyo Arkar phyo.arkarl...@gmail.com wrote: Hello Web2py. As a practice for integrating Qooxdoo and web2py. I had created a Point of Sales system for my wife's sushi shop. All people who have trouble integrating Qooxdoo, can base on my code. It used multiple Qooxdoo features . - Tables - Folder Trees - Events - Event Bubbling - Delegates - Custom Class - AJAX - Datastore and controllers - Remote Table Now i decided to release it as opensource. Please check : http://code.google.com/p/herspos/ --- HersPOS Web2py + Qooxdoo based resturant POS . Feel feel to use and contribute! Started for my wife's Sushi Restaurant, and as a practice for Qooxdoo framework , integrating with web2py.Now avaliable for everyone.This project is not completed yet, but mostly functional. Features : - Full application UI powered by Qooxdoo - AJAX View of item records using Qooxdoo table. - AJAX View of sales records. - Add new sales record. - Add new items. - Totals summary. Todo : - Sorting - Filter by date (Clicking on left tree) - Filtering by items (Clicking on left tree) - Editing records
[web2py] Re: JSONDecodeError: No JSON object could be decoded
ok, do you know a javascript client example? Thanks, On Oct 30, 12:42 am, Jonathan Lundell jlund...@pobox.com wrote: On Oct 29, 2011, at 9:36 PM, wwwgong wrote: Hi, add 2 functinos in myapp/controller/default.py @service.run def concat(a,b): return a+b @service.jsonrpc def concat2(a,b): return a+b test them using browser 1) http://127.0.0.1:8000/myapp/default/call/run/concat?a=hellob=world -- return 'helloworld' 2) http://127.0.0.1:8000/myapp/default/call/jsonrpc/concat2?a=hellob=world -- error Traceback (most recent call last): File gluon/restricted.py, line 192, in restricted File C:/web2py/applications/myapp/controllers/default.py, line 100, in module File gluon/globals.py, line 145, in lambda File C:/web2py/applications/myapp/controllers/default.py, line 80, in call File gluon/tools.py, line 3937, in __call__ File gluon/tools.py, line 3776, in serve_jsonrpc File gluon/contrib/simplejson/__init__.py, line 386, in loads File gluon/contrib/simplejson/decoder.py, line 403, in decode File gluon/contrib/simplejson/decoder.py, line 421, in raw_decode JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0) I am able to run todoApp from web2py book, so json module should be working, but why cannot I test jsonrpc this way in browser? The JSON-RPC service expects a JSON object (with specific content) as input. You're not providing it. Thanks, Wen
[web2py] JSONDecodeError: No JSON object could be decoded
Hi, add 2 functinos in myapp/controller/default.py @service.run def concat(a,b): return a+b @service.jsonrpc def concat2(a,b): return a+b test them using browser 1) http://127.0.0.1:8000/myapp/default/call/run/concat?a=hellob=world -- return 'helloworld' 2) http://127.0.0.1:8000/myapp/default/call/jsonrpc/concat2?a=hellob=world -- error Traceback (most recent call last): File gluon/restricted.py, line 192, in restricted File C:/web2py/applications/myapp/controllers/default.py, line 100, in module File gluon/globals.py, line 145, in lambda File C:/web2py/applications/myapp/controllers/default.py, line 80, in call File gluon/tools.py, line 3937, in __call__ File gluon/tools.py, line 3776, in serve_jsonrpc File gluon/contrib/simplejson/__init__.py, line 386, in loads File gluon/contrib/simplejson/decoder.py, line 403, in decode File gluon/contrib/simplejson/decoder.py, line 421, in raw_decode JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0) I am able to run todoApp from web2py book, so json module should be working, but why cannot I test jsonrpc this way in browser? Thanks, Wen
[web2py] Re: Web2py MVC and Qooxdoo
Hi Phyo, I have exactly the same question as yours when you first started this thread 1 month ago. can you share your working sample with qooxdoo and web2py integration? I am interested in using Qooxdoo for custom UI in front of web2py. Thanks, Wen my email=wen.g.g...@gmail.com On Sep 19, 3:31 pm, Phyo Arkar phyo.arkarl...@gmail.com wrote: yeah , how abt retrofittingQooxdoointo pyjamas? it should work. It will be easier. Then introduce it into web2py how thats soudns? I only tested pyjamas a bit. after coding mnore and more inQooxdoo,I realize jquery-UI main weakness is making user depending on html and css , and selectors. Actually that wont work for application style UIs. why i like about qooxdoois i never (really never) have to look back at html and CSS at all. another main point is as i am a java hater , even thoqooxdoocode is much like java its still in javascript so its a lot easier.And not like GWT it dont need java to do anything at all just python to generate and compile code :) . On 9/20/11, Ross Peoples ross.peop...@gmail.com wrote: I have been looking atqooxdooas a replacement for jQuery UI for quite a while, since they seem to have a nice set of widgets. I don't know why it takes the jQuery UI team over a year to make a menubar widget (that's still not finished), when you could probably write your own high-quality version in a couple of days. That is the one thing that really bugs me about jQuery UI: the seemingly stagnent development pace. I understand that things like accessibility take a little more time, but other frameworks (and even individuals) can crank out new widgets in no time that are sometimes higher quality than the jQuery UI ones. (end rant) Anyways, as you mentioned, web2py is focused more on traditional HTML. Qooxdooseems to generate its own HTML based on the JavaScript code you enter (like with desktop programming). It seems more like an AJAX application builder rather than an HTML additive, like jQuery. Before coming to web2py, I evaluated Vaadin, which is a Java server/client integrated framework that is built on Google Web Toolkit (like pyjamas is). Only you program everything in Java. It's pretty powerful and the widgets were the best I've ever seen (quite a lot of them too). The only problem with it though is that trying to do something that would be simple with HTML and JavaScript would require you to make your own widget and recompile the entire widget set. It was great for working inside the box, but way too difficult if you wanted to step outside the box. Enough with the babbling: what we would need to do is make aqooxdoohelper that can generate JS code for the widgets. However, it might just be easier for everyone to write their own JavaScript, since it's well documented on theqooxdoosite. As for the AJAX communications, according to theqooxdoo site:http://manual.qooxdoo.org/1.4.x/pages/communication/rpc.htmlthey use JSON-RPC, which web2py already supports. They also have a Python RPC server (for an older version of qooxdoo):http://qooxdoo.org/contrib/project/rpcpythonso that could probably integrated into a web2py plugin or contrib module. Source link: https://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib/t... So to have web2py supportqooxdooapps, it would take a little bit of work, but it's totally do-able, and some of the pieces are already there.
[web2py] Re: web2ruby possible?
Vote for node.js On Sep 11, 5:40 pm, dustin.b dustin.bens...@googlemail.com wrote: 1+ vote for node.js ;) On 11 Sep., 21:14, David Marko dma...@tiscali.cz wrote: Or to node.js :-)
[web2py] Re: web2py received 2011 BOSSIE Award by InfoWorld.com
Interesting to read. you should watch a new documentary 'Forks over Knives' (http:// www.forksoverknives.com/) because we want you to live longer and keep web2py going. By the way, I am introducing web2py to 11 year old kids in my python class. Hope more people to introduce this cool stuff to kids. Amazing thing will happen. Thanks you Wen On Sep 10, 6:35 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: LOL who is Massimo as a man in the society, among friends, does he drive a Ferrary or a fiat 500? 11 years old Honda Civic but only 60K miles on it. I do not drive much. I like trains and planes. My son his 6 and he also prefers trains and planes. Does he eat meat or is a vegetarian. Is he good at other stuff or was just born to bring us web2py ? I do eat meat. I feel guilty about it but I cannot stand vegetables. I was born to be a high energy physicist. I ended up being a professor of Computational Finance (although this quarter I am teaching how to build Physics Engines for games). web2py is an accident. What are his projects in the future. How does he sees Web2py in 5 years? You should tell me that. I will continue work on it and try make it better. I do not believe that software can last 5 years without major changes. Anyway, seriously. web2py is what it is because lot of smart people are here and have contributed to it. When I made web2py 1.0 my goals were modest and web2py has vastly exceeded these goals. I am trying not to impose a vision of what it should do except I try to enforce: - backward compatibility - a uniform and intuitive api You guys have been teaching me a lot of things that I did not know 3 years ago including how to use distributed version control systems (and am still a noob) and how to manage people.
[web2py] web2py received 2011 BOSSIE Award by InfoWorld.com
Congratulations! more details from here: http://www.infoworld.com/d/open-source-software/bossie-awards-2011-the-best-open-source-application-development-software-171759-0current=10last=1#slideshowTop