Re: [web2py] Re: export-table timeout?
In my experience recently I had many problems with pymysql, so I switch to mysqldb using dal. El 15/03/2013 13:18, Jonathan Lundell jlund...@pobox.com escribió: On 15 Mar 2013, at 8:15 AM, Niphlod niph...@gmail.com wrote: you could set some filters and with the frid it should export only the records shown, not the whole table I think I'll write a script to parse the database dump into a csv file instead; it's a lot quicker. But this seems like a bug to me: at least in the admin app, a table export ought to Just Work; it's pretty trivial, after all, even if it's large. PS: passing driver_args = {} should do the job with pymysql, but I don't see any forums showing that that kind of error is driver-dependant on some kind of timeout parameter (as is in sqlite) seems a mysql configuration directive (meaning my.cnf, mysql.ini, etc)... *wait_timeout = * *connect_timeout =* or more probably *net_read_timeout* cfr. http://dev.mysql.com/doc/refman/5.0/en/error-lost-connection.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. -- --- 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] Merry Christmas everybody!
Merry Christmast! 2012/12/25 ゴー・ニコライ nikolai...@gmail.com Happy Festivus! On Tuesday, December 25, 2012, Massimo Di Pierro wrote: Merry Christmas everybody! -- -- -- http://martinmulone.com.ar --
Re: [web2py] Happy Programmers' Day
+1 2012/9/12 Massimo Di Pierro massimo.dipie...@gmail.com https://en.wikipedia.org/wiki/Programmers'_Day -- -- http://martinmulone.com.ar --
[web2py] static blog
http://blog.martinmulone.com.ar/post/996-static-blog-in-web2py -- http://martinmulone.com.ar --
Re: [web2py] Re: static blog
Yes is based on the book app. I made some changes, in the index I made a change that read extract.markmin because abstract in info.txt is to short in lenght, but I have to render to a file like chapters because is to slow to read it all the time to make an index of posts. Ok I'm going to change this on markmin. Also is not need it for this porpouse to create a subfolder, so I create post-XXX.html and for index pages posts-X.html. The blog is based on this. 2012/9/7 Massimo Di Pierro massimo.dipie...@gmail.com +1 I see you used some of the book code in the book. In particular you use MARKMIN the way it is done in the book using extra variables. That is ok and it is done for backward compatibility with old book sources which also need to processed in latex. If that is not important there is a batter way to use markmin: from gluon.contrib.autolinks import expand_one html = MARKMIN(page.body,url=True,environment={}, autolinks=lambda link: expand_one(link,{})).xml() Because url = True you will be able to use the @ notation to reference any URL in the app. The book code prevents that for backward compatibility. autolinks=lambda link: expand_one(link,{}) enables OMEBED which means if you do not have to markup links. Web2py will automatically embed, images video and other objects using the OEMBED protocol. Massimo On Friday, 7 September 2012 07:01:21 UTC-5, Martin.Mulone wrote: http://blog.martinmulone.com.**ar/post/996-static-blog-in-**web2pyhttp://blog.martinmulone.com.ar/post/996-static-blog-in-web2py -- http://martinmulone.com.ar -- -- http://martinmulone.com.ar --
Re: [web2py] Re: static blog
I'm not sure if I understand, there no admin, you make post copying and pasting new folder under source_blog in the app, and editing files using your favorite editor like gedit, ultraedit, any ide, etc. 2012/9/7 Ovidio Marinho ovidio...@gmail.com You are missing an administrator, or is it just me? Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil 2012/9/7 Martín Mulone mulone.mar...@gmail.com Yes is based on the book app. I made some changes, in the index I made a change that read extract.markmin because abstract in info.txt is to short in lenght, but I have to render to a file like chapters because is to slow to read it all the time to make an index of posts. Ok I'm going to change this on markmin. Also is not need it for this porpouse to create a subfolder, so I create post-XXX.html and for index pages posts-X.html. The blog is based on this. 2012/9/7 Massimo Di Pierro massimo.dipie...@gmail.com +1 I see you used some of the book code in the book. In particular you use MARKMIN the way it is done in the book using extra variables. That is ok and it is done for backward compatibility with old book sources which also need to processed in latex. If that is not important there is a batter way to use markmin: from gluon.contrib.autolinks import expand_one html = MARKMIN(page.body,url=True,environment={}, autolinks=lambda link: expand_one(link,{})).xml() Because url = True you will be able to use the @ notation to reference any URL in the app. The book code prevents that for backward compatibility. autolinks=lambda link: expand_one(link,{}) enables OMEBED which means if you do not have to markup links. Web2py will automatically embed, images video and other objects using the OEMBED protocol. Massimo On Friday, 7 September 2012 07:01:21 UTC-5, Martin.Mulone wrote: http://blog.martinmulone.com.**ar/post/996-static-blog-in-**web2pyhttp://blog.martinmulone.com.ar/post/996-static-blog-in-web2py -- http://martinmulone.com.ar -- -- http://martinmulone.com.ar -- -- -- http://martinmulone.com.ar --
Re: [web2py] Re: static blog
book app and this are static generation of the content, focus on lightweight aproach. Auth.wiki is all included is a cms, auth, edit create, delete system grid, etc. I think you can render a pdf with no problem from markmin. 2012/9/7 Andrew W awillima...@gmail.com Good work Martin, I was thinking of looking at the book app for the same purpose. I want to document some Disaster Recovery procedures, so I therefore also need to create a PDF version as well. Do you think the book app vs auth.wiki() is better (easier?) for generating PDFs.? So many choices! -- -- http://martinmulone.com.ar --
Re: [web2py] Re: web2py book on github
Thanks massimo, this is a huge advance!, and the app is also very cool. I started translation to spanish based on fork (29-english), here https://github.com/mulonemartin/web2py-book. 2012/9/3 Massimo Di Pierro massimo.dipie...@gmail.com Planning to add that by the end of the week. On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote: On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di Pierro wrote: The web2py book app has been rewritten http://www.web2py.com/book Does this mean the PDF is also (automatically) updated ? I checked online, the PDF still says Build Date December 2011 -Mandar -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Re: web2py book on github
I know but it's not in markmin, and make changes and sync is a hell pain. Google translation is funny, is not serious. 2012/9/3 Massimo Di Pierro massimo.dipie...@gmail.com Mind that I believe there is already around a spanish translation of the 3rd edition. There is also this version translated by google: https://dl.dropbox.com/u/18065445/web2py/web2py_manual_es.pdf and this one translated in portuguese by google: https://dl.dropbox.com/u/18065445/web2py/web2py_manual_pt.pdf On Monday, 3 September 2012 13:28:35 UTC-5, Martin.Mulone wrote: Thanks massimo, this is a huge advance!, and the app is also very cool. I started translation to spanish based on fork (29-english), here https://github.com/**mulonemartin/web2py-bookhttps://github.com/mulonemartin/web2py-book. 2012/9/3 Massimo Di Pierro massimo@gmail.com Planning to add that by the end of the week. On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote: On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di Pierro wrote: The web2py book app has been rewritten http://www.web2py.com/book Does this mean the PDF is also (automatically) updated ? I checked online, the PDF still says Build Date December 2011 -Mandar -- -- http://www.tecnodoc.com.ar -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Re: web2py book on github
I'm using 36, but this can be changed very easy in the app. 2012/9/3 Bruno Rocha rochacbr...@gmail.com Martin, I am doing the same for portuguese. Which number did you named your spanish version? 36-spanish-work-in-progress ? I forked and I will put a 37-portuguese-work-in-progress On Mon, Sep 3, 2012 at 4:27 PM, Martín Mulone mulone.mar...@gmail.comwrote: I know but it's not in markmin, and make changes and sync is a hell pain. Google translation is funny, is not serious. 2012/9/3 Massimo Di Pierro massimo.dipie...@gmail.com Mind that I believe there is already around a spanish translation of the 3rd edition. There is also this version translated by google: https://dl.dropbox.com/u/18065445/web2py/web2py_manual_es.pdf and this one translated in portuguese by google: https://dl.dropbox.com/u/18065445/web2py/web2py_manual_pt.pdf On Monday, 3 September 2012 13:28:35 UTC-5, Martin.Mulone wrote: Thanks massimo, this is a huge advance!, and the app is also very cool. I started translation to spanish based on fork (29-english), here https://github.com/**mulonemartin/web2py-bookhttps://github.com/mulonemartin/web2py-book. 2012/9/3 Massimo Di Pierro massimo@gmail.com Planning to add that by the end of the week. On Monday, 3 September 2012 11:41:56 UTC-5, Mandar Vaze wrote: On Saturday, September 1, 2012 10:30:49 PM UTC+5:30, Massimo Di Pierro wrote: The web2py book app has been rewritten http://www.web2py.com/book Does this mean the PDF is also (automatically) updated ? I checked online, the PDF still says Build Date December 2011 -Mandar -- -- http://www.tecnodoc.com.ar -- -- http://www.tecnodoc.com.ar -- -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Re: web2py 2.0.2 is out
+1 2012/8/30 Anthony abasta...@gmail.com Congratulations to all! And special thanks to Massimo for all his hard work, diligence, and patience. Anthony On Wednesday, August 29, 2012 11:41:34 PM UTC-4, 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.idhttp://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 (nice for spikes of processing power) discard_results to completely discard the results (if you don't need the output of
Re: [web2py] Re: Twitter Bootstrap scatfolding application *updated.
It's just an application, it's just my way of doing thing what I'm sharing, I'm not proposing like a replacement to welcome. Perhaps I have to warn to not use it, because is different and I think most of people working on web2py have to have your owns scatfolding app or already have it. Today is boostrap perhaps tomorrow is bootstrap 12 or trapboost...I have not problem with this. If you like it, go for it. I usually do in my cycle of making applications: 1) Clone scatfolding (lease bootstrap, or whatever layout popular of the moment ) as a new app 2) Hack the scatfold and do the app 3) finish the work and make app ready. New app? ok, we need to make changes to scatfold? make changes and start again with new app with point 1). I have doing this way for around 2 years in web2py and never do a breakage. I think web2py lacks on giving a very minimal app, is only giving a complex welcome, this will perhaps help to teach basic functions on newones. Massimo you talk about the block header, sidebar, I know you have to force compatibility, but this kind of programming is wrong in my point of view, welcome introduce some complex code in layout and in view that also ruin performance to show some sidebar. The people have to know that is developing a web application, so have to learn HTML and CSS, with grid system is more easy than ever to make this achiviement. Yes perhaps anytime is an issue. Flash work like normal nothing new there. What is missing, I think only grid I forgot. Martin. 2012/8/23 Massimo Di Pierro massimo.dipie...@gmail.com Martin, it is really well done but, as it is, it not appropriate for out scaffolding app. First of all it relies on many bootstrap specific helpers. Menus work in a different way than documented. Flash has a more complex html structure and does not provide a good example for new users. It is based on anytime.js while we moved to calendar.js. The html lacks the blocks for header, footer and sidebar. Many web2py specific styles are missing. Yours is a more a by-the-book bootstrap app than welcome is but welcome is designed above all to provide an example for new users who may or not want to use bootstrap. The fact that is uses bootstrap is accidental and only affects the CSS. It is in principle possible to merge it with the scaffolding but we would still need to fix menus. Perhaps we should do it but web2py 2.0 has waited long enough, mostly because of css. I would not want to put it off more because we have a new css option. Massimo On Thursday, 23 August 2012 13:48:03 UTC-5, Martin.Mulone wrote: Twitter Bootstrap scatfolding application *updated. Now is awesome :-P * Now based on version 2.1.0 (sync) * Menu based on twitter bootstrap navbar (support multilevel menu) * Plugin highlight. * Many fixes to layout now support responsive. * Very clean layout. * Started to document (getting) * Some examples. * Flash is render as alert. Working demo: http://testbootstrap.tecnodoc.**com.ar/http://testbootstrap.tecnodoc.com.ar/ Doc: http://testbootstrap.tecnodoc.**com.ar/gettinghttp://testbootstrap.tecnodoc.com.ar/getting Source: https://bitbucket.org/**mulonemartin/bootstraphttps://bitbucket.org/mulonemartin/bootstrap Note: Not yet fully tested. -- -- http://www.tecnodoc.com.ar --
[web2py] Twitter Bootstrap scatfolding application *updated.
Twitter Bootstrap scatfolding application *updated. Now is awesome :-P * Now based on version 2.1.0 (sync) * Menu based on twitter bootstrap navbar (support multilevel menu) * Plugin highlight. * Many fixes to layout now support responsive. * Very clean layout. * Started to document (getting) * Some examples. * Flash is render as alert. Working demo: http://testbootstrap.tecnodoc.com.ar/ Doc: http://testbootstrap.tecnodoc.com.ar/getting Source: https://bitbucket.org/mulonemartin/bootstrap Note: Not yet fully tested. --
Re: [web2py] Re: Congratulations to Bruno and Mariano
Congrats! both are great pythonistas and web2pyistas!. 2012/8/18 samuel bonilla pythonn...@gmail.com def index(): good = ''Congratulations to Bruno Rocha and Mariano Reingart return dic(good = good) -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Major speed improvement need testers
nice to hear this, I'm going to test it. 2012/8/18 Massimo Di Pierro massimo.dipie...@gmail.com There are two major speed improvements in trunk and I am not sure whether they should go in web2py 2.0 next week. 1) Lazy table (based on ideas from Bruno). db = DAL(, lazy_tables=True) db.define_table('person',Field('name')) the table is instantiated only when db.person is accessed. So with some care: Field(, requires=) # LAZY (good) db.table.field.requires = ... # NOT LAZY (bad) Field('other','reference table') # LAZY (good) Field('other',db.table) # NOT LAZY (bad) this may be a big speedup. 2) There is a new implementation of class Storage. This is a most accessed object within web2py and now it is 10x faster. Yet I am not sure if this breaks something. It would be great if you could try the nightly build (or trunk) and report if you experienced any problem. It would be even better if you could run some benchmarks of your code before and after the changes suggested at 1). Massimo -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Re: Best way to insert 200k records?
bulk insert is a way faster than regular insert when you have many rows. If you are under mysql you can use load data infile, this is incredible fast, but you need special privileges under mysql. 2012/8/19 Andrew awillima...@gmail.com Is it possible that we add a native bulk insert function which is coded up in each adapter. Even bulk_insert is an odbc 1 row at a time-slow for big files. I need to load huge files all the time and I am writing custom modules to do this with a native loader. Should this be a dal option? Worth noting that this type of operation is a batch, back end thing, I wouldn't do this for a end user web app. I would expect that each DBMS needs different info to start a bulk load, so the interface may be tricky, or just pass a dict and let the adapter work it out. What do you think? -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Killer Web Development #7
+1 2012/8/10 Massimo Di Pierro massimo.dipie...@gmail.com http://killer-web-development.com/section/7/0 Thanks Marco! Really nice. -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Announcement: Open-source meetup.com alternative released
wow 2012/8/2 Samuel Marks samuelma...@gmail.com With meetup.com, groupspaces and even facebook groups rising in popularity; it is only fitting that an open-source alternative be developed at the same time. Currently *GiantPicnic* supports: - CRUD groups - CRUD group events - Join/leave groups - RSVP to group events - View profile - Facebook login - Mobile apps made with PhoneGap - An API exposed for doing common tasks With more features to follow, including: - Membership dues - Per group and per event management - Sellable event RSVPs (i.e.: tickets) - E-commerce - Threaded group and event comments - Section for ranking of suggested talks/topics - Fine-grained RBAC within groups Source: https://bitbucket.org/SamuelMarks/giantpicnic I've released it under a BSD license—with one extra condition, so feel free to send me merge requests [?] This is my first web2py project, so you will notice a bit of hacky code here and there, and lack of caching. Please recommend where+when I should cache, and how to de-hackify the code. Thanks and I hope you enjoy my project, Samuel Marks -- -- http://www.tecnodoc.com.ar -- 330.gif
Re: [web2py] Re: bootstrap and user panel
It's a bug I think, but it's related to windows perhaps. have to be: from gluon.sqlhtml import SQLFORM the strange that this is working in linux: from sqlhtml import SQLFORM fixed in trunk. 2012/7/26 Nomad hilleratw...@gmail.com On Monday, July 23, 2012 7:02:47 PM UTC-5, Martin.Mulone wrote: I want to share this two applications* Bootstrap welcome application* I made my own welcome scatfold app, using twitter bootstrap template. My version is more like from the example template. Download: https://bitbucket.org/**mulonemartin/bootstrap/**overviewhttps://bitbucket.org/mulonemartin/bootstrap/overviewalso you can test here http://testbootstrap.tecnodoc.com.ar/. *User Panel Admin* An application to administer the auth_user table. You can add, remove, activate users/ add groups, also add users to groups and so on. https://bitbucket.org/**mulonemartin/usersadminhttps://bitbucket.org/mulonemartin/usersadmin -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Re: bootstrap and user panel
Edit model/00main.py and change migrate=False to use the current sqlite db. Or delete the content in dabase then add a user and make membership of the Admin group with appadmin. type 'exceptions.TypeError' define_tables() got an unexpected keyword argument 'signature' What am I doing wrong ? mmh perhaps because I made some changes from the trunk welcome. What version of web2py?. 2012/7/24 murtaza52 murtaza.hus...@sevenolives.com Hello Martin, The CSS is cool so +1 for this. 1) I cloned your welcome app repo and placed it under applications, this is the summary of the error I get when I browse to the app - 127.0.0.1.2012-07-24.11-12-36.3a36305c-435d-4087-ab03-e427b4e00812 class 'sqlite3.OperationalError' table auth_user already exists 2) Below is the error I recieved from the useradmin app when I did the same - 127.0.0.1.2012-07-24.11-17-36.3a723b6d-872c-49e2-878d-65fab3349ca5 type 'exceptions.TypeError' define_tables() got an unexpected keyword argument 'signature' What am I doing wrong ? Thanks, Murtaza On Tuesday, July 24, 2012 9:27:49 AM UTC+5:30, Massimo Di Pierro wrote: This looks great. Are you proposing it as a replacement for the current welcome? pros? cons? On Monday, 23 July 2012 19:02:47 UTC-5, Martin.Mulone wrote: I want to share this two applications* Bootstrap welcome application* I made my own welcome scatfold app, using twitter bootstrap template. My version is more like from the example template. Download: https://bitbucket.org/**mulonemartin/bootstrap/**overviewhttps://bitbucket.org/mulonemartin/bootstrap/overviewalso you can test here http://testbootstrap.tecnodoc.com.ar/. *User Panel Admin* An application to administer the auth_user table. You can add, remove, activate users/ add groups, also add users to groups and so on. https://bitbucket.org/**mulonemartin/usersadminhttps://bitbucket.org/mulonemartin/usersadmin -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Unit Testing Database Best Practices
I'm following http://www.web2py.com/AlterEgo/default/show/260 that guide is too old, have execfile() :S. Search in the group on how to use modules in your app. 2012/7/22 Mark Li markruole...@gmail.com I'm fairly new to test-driven development and have decided it is the best way to go for my new webapp. While functional tests with selenium seem to be more straightforward (as far as what the tests want to accomplish), I'm lost on what unit tests for the database should test for. For example, if I have a database table with columns id, 'dogowner', and 'dogname', and have a controller returning a dict with 'dogowners', what should I be testing in the unit tests for the database and controller? The database table will be fixed with a limited number of 'dogowner' entries, about 10, so should I be testing whether the database has 10 entries, and if the len of the dict returned by the controller is 10? This datatable may not be fixed in the future, so what functionality of the database would I be testing for? I'm following http://www.web2py.com/AlterEgo/default/show/260 , but while that page explains HOW to go about unit testing, it doesn't explain what I should be testing for. Anyone experienced with TDD in web2py want to point me in the right direction? Thanks in advance! -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Re: A Web2py CMS like Joomla ?
Yes I was a bit disappear cause personal problems, I know there are some bugs reported, I'm a little busy at the moment but I have in mind to make changes to instant press. As bruno said I didn't get any contribution from the project, but is open source feel free to merge /fork or whatever. 2012/7/19 Bruno Rocha rochacbr...@gmail.com The only problem here is WHO will build the Killer web2py CMS? Instant Press is built by @Martin and I dont know if he gets contribution Movu.ca is built by @rochacbruno (me) and I did not get too much contribution (two or 3 people helped with ideas and translations) Sorry community, but we do not have to expect a ready-to-use solution if nobody contributes with running code! Both projects are open source in github or bitbicket. get the source, propose patches, send pull requests. Lets put our forces together and may be build the next-great-web2py-thing! it have not to be called Movuca, aldo it has not to be called Instant Press, but I think community should take these two projects as example and may be merge/fork/contribute. I made movu.ca for my own needs (http://www.menuvegano.com.br) - so I put all my efforts on my own needs, as I am a programmer, I dont need facilities, installers, plugins etc.. I think Martin has made IPress for his own needs. But we love open-source, and we shared our source codes expecting to receive contributions! I will be very happy if somebody gets Movu.ca source from github, fork, or only copy some ideas and release a new killer-cms for the community! The projects are open for you to put the hands on and code, change, propose! Lets go! -- -- http://www.tecnodoc.com.ar --
Re: [web2py] Re: Apache wsgi virtualhost configuration for multiple web2py sites
perhaps this can help you http://martin.tecnodoc.com.ar/post/2012/02/08/14_setup-virtual-hosting-with-web2py-and-apache2-mod-wsgi-on-ubuntu-server-1110 2010/12/13 Vincent vincentdavis...@gmail.com I am interested in a little different setup, I would like *.example.com to go to the web2py app/folder but be able to specify other.example.com be served from /var/www/other/ I am having trouble figuring out how to configure Apache virtual host to do this. Thanks Vincent On Oct 18, 7:07 pm, VP vtp2...@gmail.com wrote: The way I did this is through Apache, by adding ServerName domain.com ServerAlias *.domain.com to the web2py configuration section in site-enabled/000-default Which one is more preferable? pros and cons? Thanks. -- http://www.tecnodoc.com.ar
Re: [web2py] Need a little help in code review (a function eating up all memory)
The problem is fetchall(), is getting all the records to memory. If you want to iterate a large dataset or not so heavy, but have a table with many fields, perhaps you can do it by blocks. For example using raw sql with dal: example: this fetch by 1000 records queryraw = select * from mytable %(limit_query)s def records(query): rows = db.executesql(query) if rows: return True else: return False rec = 0 stage = 0 block = 1000while True: offset = stage * block query = queryraw % {'limitquery': 'LIMIT %s, %s' % (offset, block)} if not records(query): break rows = db.executesql(query) for row in rows: rec += 1 # do something stage += 1 This is not fast but keep memory low. 2012/5/10 szimszon szims...@gmail.com Could it be related? https://groups.google.com/forum/#!topic/web2py/hmsupVHdDHo/discussion (Memory leak in standalone DAL (issue #731), can you please help test?) 2012. május 10., csütörtök 22:32:53 UTC+2 időpontban szimszon a következőt írta: Okay. It's clear. I'm only puzzled about why the memory didn't get freed or reused after execution is finished. And if I execute the controller function in 1-2min interval mem is still not reused. So I understand it can eat up the memory but why is all memory locked forever and didn't get reused - in my understanding (it's not much) in my case GC do not free mem at all in python level. So some reference is still intact after function is finished. 2012. május 10., csütörtök 21:53:06 UTC+2 időpontban Richard a következőt írta: Ok, you don't need it to works all the time. Did you get it to update your records? If not, and if as you said it is a one trip, you can just treat the whole records batch by batch... Look here : http://web2py.com/books/**default/chapter/29/14#** Populating-database-with-**dummy-datahttp://web2py.com/books/default/chapter/29/14#Populating-database-with-dummy-data for i in range(10): populate(db.mytable,100) db.commit() In this example only 100 records are populated at a time between db.commit()... So maybe you just have to wrap for loop that will db.commit() a couples of time during your processing. Richard On Thu, May 10, 2012 at 3:32 PM, szimszon szims...@gmail.com wrote: I had to store files and a lot of properties for it. It was in csv. But after I processed it we figured out that not all value was correct in csv but it was a bit redundant. So I can correct it by go through all the records row by row. So that was a one time trip. I just realized after the process I had no memory left. So now I'm investigating what happened... 2012. május 10., csütörtök 21:00:05 UTC+2 időpontban Richard a következőt írta: Yes but in this case it is not for the entire reecords... Why would you return a full list of all the records? I don't understand what is the purpose of listar that you return in the view under a html table, why do you need to return all the 10+ entries? Richard On Thu, May 10, 2012 at 2:56 PM, szimszon szims...@gmail.com wrote: In book it is a recommended way to iterate over sql results: http://web2py.com/books/**defaul**t/chapter/29/6http://web2py.com/books/default/chapter/29/6 You can do all the steps in one statement: 1. 2. 3. for row in db(db.person.name=='Alex').select(): print row.name Alex 2012. május 10., csütörtök 20:42:22 UTC+2 időpontban Bruce Wade a következőt írta: Sorry, you really need to read more about how python works. If you learn how for loops work and memory you will understand the problem. One solution do the query before the for loop then loop through the objects. This may help at bit. Research xrange vs range On Thu, May 10, 2012 at 11:30 AM, szimszon szims...@gmail.comwrote: Sorry I don't understand. What do you mean achieve with join? There is an empty for loop with db.executesql() without join. And it is eating up the memory. :( 2012. május 10., csütörtök 19:12:30 UTC+2 időpontban Richard a következőt írta: You can't manage what you want to achieve with join? Richard On Thu, May 10, 2012 at 10:48 AM, szimszon szims...@gmail.comwrote: Sorry for my dumbness but if something is wrong with my code please point me the right line. I'm not so good in English if it comes to object instance count and so. Yeah I know I should go and do some milkmaid job :) but I'm curious. I'm just define some variable: lista = list() last_row = None next_page_number = 0 Go in a for loop that just assign the db query result one-by-one to row variable. After that I assign the TABLE() helper to a list variable. That is it. 2012. május 10., csütörtök 16:34:49 UTC+2 időpontban Bruce Wade a következőt írta: Using direct sql query or DAL is going to cause the exact same problem in this situation. On Thu, May 10, 2012 at 7:28 AM, szimszon szims...@gmail.comwrote: It's postgres:// in a Version
Re: [web2py] Re: Limit SQLFORM.grid results
perhaps we can make some lambda to count, but make sure that is the count() thing, run some benchmark. 2012/4/23 Niphlod niph...@gmail.com unfortunately counting on postgres is a heavy operation, and it's pretty famous for this http://wiki.postgresql.org/wiki/Slow_Counting. maybe you can try limiting the amount to, let's say, 2 (if it's possible as per requirements of your app) and see if there are differences. In theory SELECT COUNT(*) from mytable and SELECT COUNT(*) from mytable LIMIT 2 for a 50 records table is faster. You could have a default grid of the 2 records and then an advanced if users are willing to scroll over the n-thousand-x page. -- http://www.tecnodoc.com.ar
Re: [web2py] Re: Limit SQLFORM.grid results
Perhaps the slowdown comes, counting such amount of records. 2012/4/22 Massimo Di Pierro massimo.dipie...@gmail.com This is the logic in sqlhtml.py SQLFORM.grid if paginate and paginatenrows: limitby = (paginate*page,paginate*(page+1)) rows = dbset.select(left=left,orderby=orderby,limitby=limitby,*table_fields) as you can see it does not fetch all rows when paginating, unless there is a bug I am now aware of. If there is it should be fixed but need to see the code that is causing the bug. Massimo On Sunday, 22 April 2012 11:37:14 UTC-5, Bruce Wade wrote: The grid is limiting the amount on the page being displayed. however it is still querying all the records then creating the pages so you can page between them. The query still queries all of the data instead of using limits and or ajax. for 50,000 records it takes almost 3-8 seconds to load the page. db.dailyadviews.id.readable = db.dailyadviews.ad_id.readable = db.dailyadviews.viewer_id.**readable = db.dailyadviews.accepted.**readable = False grid = SQLFORM.grid(db.dailyadviews.**ad_id == ad_id, create=False, editable=False, deletable=False, details=False, args=[ad_id] ) On Sun, Apr 22, 2012 at 9:26 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: This is what I do not understand. If the query is done by the grid, it should limit the number of records to the number of records displayed. If that now happening? Are you calling the query outside of the grid? On Sunday, 22 April 2012 11:22:32 UTC-5, Bruce Wade wrote: Yes it has built in pagination, however some of my grids will return over 500,000+ records which causes query's to be very very very slow. I would rather limit the returned data because the average person is not going to go through all them records or care about them. For example currently there has been around 19 million adviews each of these records contains a rating, however there is no way SQLFORM.grid can handle loading that much data. For some data I can use a date range however other tables we are not storing a date field so I can not use that process to limit the results. On Sun, Apr 22, 2012 at 9:13 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: grid has built-in pagination. Perhaps I do not understand the question. Can you show us your code? On Sunday, 22 April 2012 10:40:37 UTC-5, Bruce Wade wrote: Hi, Is there a way to limit the returned results for the grid? I am finding that my site has so much data already that most areas where I am using grid are failing class 'psycopg2.InternalError' current transaction is aborted, commands ignored until end of transaction block If there is no way to limit the results is there a specific reason why this was never included? -- -- Regards, Bruce Wade http://ca.linkedin.com/in/**brucelwadehttp://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.fittraineronline.**comhttp://www.fittraineronline.com- Fitness Personal Trainers Online http://www.warplydesigned.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/**bruc**elwadehttp://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.fittraineronline.**co**m http://www.fittraineronline.com- Fitness Personal Trainers Online http://www.warplydesigned.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/**brucelwadehttp://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.fittraineronline.**com http://www.fittraineronline.com - Fitness Personal Trainers Online http://www.warplydesigned.com -- http://www.tecnodoc.com.ar
Re: [web2py] Re: grid without delete botton
use the parameter deletable=False SQLFORM.grid(...deletable=False ... ) 2012/4/2 Manuele Pesenti manuele.pese...@gmail.com excuse me I forgot to complete the object... Il 02/04/2012 10:46, Manuele Pesenti ha scritto: Hi, is there an easy way to use grid and smartgrid without the delete botton? I mean I want to only use the deleting option from the update form not the botton in the table because in this case no callback function are performed ( http://code.google.com/p/**web2py/issues/detail?id=651http://code.google.com/p/web2py/issues/detail?id=651 ) I've had a look of the SQLFORM.grid code in sqlhtml.py but at the moment I didn't realize how to solve it so I need to by pass. thanks Manuele -- http://www.tecnodoc.com.ar
Re: [web2py] Re: web2py ported to bottle, flask, pyramid, tornado, wsgiref
Yes sorry I delete some old thread in my blog the last month. But yes I worked integrating web2py dal in bottle some months ago, here https://bitbucket.org/mulonemartin/bottle-web2pydal/overview now I think is obsolete, go into gluino instead. Perhaps need a lot of test, some time ago, I remember I have trouble with wsgi and bottle in the way of the example in gluino perhaps adapating to use install like this: from bottle import route, view, run, debug, install from bottle_dal import DALPlugin, Field def define_tables(db): My tables definitions here db.define_table('person',Field('name','string')) install(DALPlugin('sqlite://storage.sqlite', define_tables = lambda db: define_tables(db))) @route('/') def index(db): Index Example if db(db.person.id0).count()==0: db.person.insert(name='James') db.person.insert(name='Michael') db.person.insert(name='Steve') db.person.insert(name='Robert') db.commit() persons = db(db.person.id0).select() return dict(persons=persons.json()) if __name__ == '__main__': debug(True) run(host='localhost', port=8080) 2012/3/15 Andrew awillima...@gmail.com When would I choose something like Bottle over using straight web2py? What's the difference from bottle with gluino, and web2py? Martin M, you used to have bottle on your blog site. I went to have a look but it's gone. So many choices !? Thanks Andrew On Mar 14, 4:22 pm, Bruno Rocha rochacbr...@gmail.com wrote: Amazing! just installed using easy_install on windows! *c:\Python27\Scriptseasy_install.exe gluino* Searching for gluino Readinghttp://pypi.python.org/simple/gluino/ Readinghttps://github.com/mdipierro/gluino Best match: Gluino 0.1 Downloadinghttp:// pypi.python.org/packages/source/G/Gluino/Gluino-0.1.tar.gz#md 5= 89d645322f6a0af56f80ba8df6f84e34 Processing Gluino-0.1.tar.gz Running Gluino-0.1\setup.py -q bdist_egg --dist-dir c:\users\rochac~1\appdata\lo cal\temp\easy_install-qcludi\Gluino-0.1\egg-dist-tmp-m_pspc zip_safe flag not set; analyzing archive contents... gluino.custom_import: module references __file__ Adding gluino 0.1 to easy-install.pth file Installed c:\python27\lib\site-packages\gluino-0.1-py2.7.egg Processing dependencies for gluino Finished processing dependencies for gluino c:\Python27\Scriptspython Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win 32 Type help, copyright, credits or license for more information. * from gluino import ** No handlers could be found for logger web2py -- http://www.tecnodoc.com.ar
Re: [web2py] using form in same page?
To edit an image you need to pass the id of the row to SQLFORM. Ex.: row_id = 1 form = SQLFORM(db.ref, row_id) 2012/3/11 juvi1 juha.wilh...@gmail.com thanks, but now form create always new image in database, and i want update image. how it can be done?? sunnuntaina 11. maaliskuuta 2012 13.37.36 UTC+2 Martin.Mulone kirjoitti: I don't know why you have two {{pass}} in your view. I think you can do: def jobs(): images=db().select(db.ref.id,**db.ref.file) form = SQLFORM(db.ref) if form.process().accepted: response.flash = Image uploaded return dict(form=form, images=images) in views: {{for img in images:}} imageimg width=85px src={{=URL('download', args=img.file)}} /br/image brbrbrbrbr {{=img}} {{=img.id}} {{=form}} {{pass}} 2012/3/11 juvi1 juha.wilh...@gmail.com Hello sorry my bad english and i hope that you understand my problem. I want show in one page all pictures which are saved in database. In page i want that i can upload new picture and update it whit forms (override old one) My code are in controller: def jobs(): images=db().select(db.ref.id,**db.ref.file) for img in images: formname = upload_f_%s%img.id form = FORM(INPUT(_type=file,_name=**formname), INPUT(_type='submit')) if form.accepts(request.vars, _name=formname): response.flash = form.vars return dict(form=form, img=img, formname=formname, images=images) in views: {{for img in images:}} imageimg width=85px src={{=URL('download', args=img.file)}} /br/image brbrbrbrbr {{=img}} {{formname=img.id}} {{=formname}} {{=form}} {{pass}}{{pass}} please help! -- http://www.tecnodoc.com.ar -- http://www.tecnodoc.com.ar
Re: [web2py] using form in same page?
The easy way is to add another controller edit_image and add a link to this in each image. (controller/default.py) def edit_image(): row_id = request.args[0] form = SQLFORM(db.ref, row_id) if form.process().accepted: response.flash = Image uploaded else: response.flash = form.vars.id (view) {{for img in images:}} imageimg width=85px src={{=URL('download', args=img.file)}} /br/image brbrbrbrbr {{=img}} {{=img.id}} {{=A('Edit', _href=URL('default', 'edit_image', args=[img.id]))}} {{pass}}{{pass}} 2012/3/12 juvi1 juha.wilh...@gmail.com this code work but i need create form in controller but how i send the img_id variable in controller (form)? {{for img in images:}} imageimg width=85px src={{=URL('download', args=img.file)}} /br/image brbrbrbrbr {{=img}} {{=img.id}} {{row_id=img.id}} {{form = SQLFORM(db.ref, row_id) if form.process().accepted: response.flash = Image uploaded+str(form.vars) else: response.flash = form.vars.id}} {{=form}} {{pass}}{{pass}} maanantaina 12. maaliskuuta 2012 14.02.10 UTC+2 juvi1 kirjoitti: https://lh4.googleusercontent.com/-C5e04mE4s8I/T13jl7HXizI/AAU/ngyK-9pCkAA/s1600/Screenshot%2520at%25202012-03-12%252013%253A51%253A57.png Sry. I dont understand. now all forms update same image (image_id1) can i send img_id (in view) to form (in controller)? I also try this code, but that insert always image_id variable = last image id in database. def jobs(): images=db().select(db.ref.id,**db.ref.file) for img in images: form = SQLFORM(db.ref, img.id) if form.process().accepted: response.flash = Image uploaded+str(form.vars) else: response.flash = form.vars.id return dict(form=form, images=images) maanantaina 12. maaliskuuta 2012 12.23.36 UTC+2 Martin.Mulone kirjoitti: To edit an image you need to pass the id of the row to SQLFORM. Ex.: row_id = 1 form = SQLFORM(db.ref, row_id) 2012/3/11 juvi1 juha.wilh...@gmail.com thanks, but now form create always new image in database, and i want update image. how it can be done?? sunnuntaina 11. maaliskuuta 2012 13.37.36 UTC+2 Martin.Mulone kirjoitti: I don't know why you have two {{pass}} in your view. I think you can do: def jobs(): images=db().select(db.ref.id,**d**b.ref.file) form = SQLFORM(db.ref) if form.process().accepted: response.flash = Image uploaded return dict(form=form, images=images) in views: {{for img in images:}} imageimg width=85px src={{=URL('download', args=img.file)}} /br/image brbrbrbrbr {{=img}} {{=img.id}} {{=form}} {{pass}} 2012/3/11 juvi1 juha.wilh...@gmail.com Hello sorry my bad english and i hope that you understand my problem. I want show in one page all pictures which are saved in database. In page i want that i can upload new picture and update it whit forms (override old one) My code are in controller: def jobs(): images=db().select(db.ref.id,**d**b.ref.file) for img in images: formname = upload_f_%s%img.id form = FORM(INPUT(_type=file,_name=formname), INPUT(_type='submit')) if form.accepts(request.vars, _name=formname): response.flash = form.vars return dict(form=form, img=img, formname=formname, images=images) in views: {{for img in images:}} imageimg width=85px src={{=URL('download', args=img.file)}} /br/image brbrbrbrbr {{=img}} {{formname=img.id}} {{=formname}} {{=form}} {{pass}}{{pass}} please help! -- http://www.tecnodoc.com.ar -- http://www.tecnodoc.com.ar -- http://www.tecnodoc.com.ar
Re: [web2py] add classes to individual menu items
I think you can do: (T('my item'), True, A('My item', _href=URL('default', 'index'), _class = 'my_item_class', id = 'my_item_id'), []), 2012/3/12 monotasker scotti...@gmail.com I want each of my app menu items to have a distinct class to ease theming (I'm using background images to provide icons in place of text). It looks like the MENU helper doesn't allow _class arguments in the items in response.menu. So I can just modify the MENU helper, but am I missing some way of doing this in the existing api? I wonder, by the way, whether it would be a good idea to extend the MENU interface to allow passing _class and/or _id arguments like this: (T('my item'), True, URL('default', 'index'), [],* _class = 'my_item_class'*, *id = 'my_item_id'*), Ian -- http://www.tecnodoc.com.ar
Re: [web2py] using form in same page?
I don't know why you have two {{pass}} in your view. I think you can do: def jobs(): images=db().select(db.ref.id,db.ref.file) form = SQLFORM(db.ref) if form.process().accepted: response.flash = Image uploaded return dict(form=form, images=images) in views: {{for img in images:}} imageimg width=85px src={{=URL('download', args=img.file)}} /br/image brbrbrbrbr {{=img}} {{=img.id}} {{=form}} {{pass}} 2012/3/11 juvi1 juha.wilh...@gmail.com Hello sorry my bad english and i hope that you understand my problem. I want show in one page all pictures which are saved in database. In page i want that i can upload new picture and update it whit forms (override old one) My code are in controller: def jobs(): images=db().select(db.ref.id,db.ref.file) for img in images: formname = upload_f_%s%img.id form = FORM(INPUT(_type=file,_name=formname), INPUT(_type='submit')) if form.accepts(request.vars, _name=formname): response.flash = form.vars return dict(form=form, img=img, formname=formname, images=images) in views: {{for img in images:}} imageimg width=85px src={{=URL('download', args=img.file)}} /br/image brbrbrbrbr {{=img}} {{formname=img.id}} {{=formname}} {{=form}} {{pass}}{{pass}} please help! -- http://www.tecnodoc.com.ar
Re: [web2py] custom css
What is not working?, you change views/layout.html? 2012/3/11 frasse frass...@gmail.com Hi I like to use my custom css and add it to my application base.css mess my application. I have remove base.css and move classes .flash and .error to my custom css file. when I do that it is not working in FireFox 10 in windows but it works in all other browser and OS (mac Ubuntu , win). Can you please help me with that ? /F -- http://www.tecnodoc.com.ar
Re: [web2py] response.menu with bootstrap dropdown menu
The menu helper (web2py) is not compatible with twitter bootstrap menu. 2012/3/7 Paolo ilva...@inventati.org Hi all, I have a simple problem that I haven't solved yet. Using the twitter bootstrap theme I am not able to create a dropdown menu playing with the MENU helper. According to [1], an anchor to create the dropdown menu needs the attributed data-toggle equal to dropdown; the problem is that I am not able to set up correctly response.menu in order to generate html code with that field inside. What I can do? Best regards -- Paolo [1] http://twitter.github.com/**bootstrap/javascript.html#**dropdownshttp://twitter.github.com/bootstrap/javascript.html#dropdowns -- http://www.tecnodoc.com.ar
Re: [web2py] The Winners! Web2py Application Exhibition Version 3.0
Congrats to the winners! 2012/3/7 NetAdmin mr.netad...@gmail.com 1st Place Prize $100 Brian Cottingham from the U.S. was the First Place Winner. His entry of MobleBlur is a mobile-friendly interface to the Newsblur RSS reading website. A working demo can be viewed at http://mobileblur.spiffyte.ch https://github.com/spiffytech/MobileBlur/tarball/master 2nd Place Prize $50 Phyo Arkar from from Burma is the Second Place Winner, with an entry of HersPOS -- A Web2py + Qooxdoo based restaurant POS http://herspos.appspot.com/HersPOS http://code.google.com/p/herspos/ - I'd like to thank Bruno Rocha and Falko Krause for helping out as judges, and I'd like to thank Massimo for a GREAT Framework! Mr.NetAdmin -- http://www.tecnodoc.com.ar
Re: [web2py] Scheduler json string for vars parm
I confirm this, the book is wrong, someone can change it?. http://web2py.com/books/default/chapter/29/4#Scheduler-(experimental) 2012/2/6 Jim Steil j...@qlf.com That did it. Thanks! How do we go about getting the book updated? Page 195 is showing the syntax I was using. -Jim On 2/6/2012 4:18 PM, Martín Mulone wrote: Yes I think the json format is strict to instead of ' change with this and try again: vars='{fromDate:2012-01-01,toDate:2012-01-31,districtNumber:0}', 2012/2/6 Jim Steil j...@qlf.com Hi I'm having trouble getting my vars json string right on my call to add a job to my scheduler. If I run with no vars, it works fine. But, when I add my json string I'm getting: Traceback (most recent call last): File C:\dev\web2py\gluon\scheduler.py, line 159, in executor vars = loads(task.vars, object_hook=_decode_dict) File C:\dev\web2py\gluon\contrib\simplejson\__init__.py, line 403, in loads return cls(encoding=encoding, **kw).decode(s) File C:\dev\web2py\gluon\contrib\simplejson\decoder.py, line 403, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File C:\dev\web2py\gluon\contrib\simplejson\decoder.py, line 419, in raw_decode obj, end = self.scan_once(s, idx) File C:\dev\web2py\gluon\contrib\simplejson\scanner.py, line 72, in scan_once return _scan_once(string, idx) File C:\dev\web2py\gluon\contrib\simplejson\scanner.py, line 43, in _scan_once _scan_once, object_hook, object_pairs_hook, memo) File C:\dev\web2py\gluon\contrib\simplejson\decoder.py, line 207, in JSONObject raise JSONDecodeError(Expecting property name, s, end) JSONDecodeError: Expecting property name: line 1 column 1 (char 1) My add_task looks like this: db.scheduler_task.insert( status='QUEUED', application_name='myApp', task_name='Task name', function_name='functionname', args='[]', vars={'fromDate':'2012-01-01','toDate':'2012-01-31','districtNumber':0}, enabled=True, start_time=request.now, stop_time=request.now+datetime.timedelta(days=1), repeats=1, timeout=600) is there something obvious I'm doing wrong? -Jim -- http://www.tecnodoc.com.ar -- http://www.tecnodoc.com.ar
[web2py] Setup virtual hosting with Web2py and apache2 mod wsgi on Ubuntu server 11.10
New blog entry http://bit.ly/xqB508 Setup virtual hosting with Web2py and apache2 mod wsgi on Ubuntu server 11.10http://martin.tecnodoc.com.ar/post/2012/02/08/14_setup-virtual-hosting-with-web2py-and-apache2-mod-wsgi-on-ubuntu-server-1110
Re: [web2py] web2py performance
You can use bulkinsert to insert huge amount of records, yes is fast. Also if you are doing long time task, you can use scheduler, to schedule your task, if you need to inform to the client browser you can use tornado , there are an example using with web2py out there, or reload the page after 5 seconds for example to check if the task is done. 2012/2/7 LightOfMooN vladsale...@yandex.ru Hi Just download web2py, run it and go to edit welcome app. in db.py: db.define_table('mytable',Field('myfield','string')) in controllers/default.py: def index(): if request.vars.add_rows: for i in xrange(10): db.mytable.insert(myfield='') rows = db(db.mytable.id0).select() response.flash = Welcome to web2py! return dict() in controllers/index.html: {{extend 'layout.html'}} form method=POST input type=submit name=add_rows value=add 100k rows / /form Let's test it. Click on add_rows button to insert 10 rows in database. Then reload page. There are just one query, that gets us one set of 100k rows. Time to process query is less than 100ms, but page loads 5-6s! Nothing passed to the view. So, my question is: Is web2py can be used in production for big sites, or just for small- home-sites? thx -- http://www.tecnodoc.com.ar
Re: [web2py] web2py long term projects: experiences ?
I can tell my experience, I'm working for 2 years with web2py or more I think. I work in different projects, one I currently developing I think is quite big, work with millons of records, and is very complex and has many lines of code and many tables, is an internal application for a national company. Also I worked in instant press from 1 year ago or more, and many other applications. In matter of scaling what I can say. Don't keep it with the basic. For me this is python and the important is the code, the beauty of the code, make sure that you application use modules, yes import is a great thing, this keep you code well order, take in mind nobody wants to read an awfull code, and in a future you can add new code and debug the problems easily. When you have a big app, models are not a good idea, this is why some experience developers quite from using web2py, the problem is that are giving up too fast, because you can avoid using models in web2py app, or at least using elemental models. You can read more why in my slides from last pycon at argentina http://www.slideshare.net/martinpm/web2py-pensando-en-grande-9448110. Also you can read examples like lessmodel application that bruno rocha made or the plugin aproach by kenshi here http://dev.s-cubism.com/plugin_jstree. Scheduler is another great piece of code, it's small but pretty powerfull, It's really nice and I use a lot. I don't know why the people are not using more. You can run a long time task to avoid timeout of the server and client with long tasks. Dal, well in my experience is great but not always I can use full of it. Many times I have heavly or complex queries that I have to pass it with executesql. But dal is working pretty well with this mix. About breakage when upgrating web2py, yes I have some, but it's my fault because sometimes I'm using experimental features and not stable, I want always the last features, I remember scheduler and grid give me some trouble with this. But in generally I have running application of about 2-3 years ago with the last version. 2012/2/3 howesc how...@umich.edu i don't know of any blogs that discuss the experiences of users over the long term. i suspect this group history might be an indication. heck, check my posts over the past couple of years - whenever i hit bumps in the road i tend to ask questions here. are there specific things we can help answer? i have used web2py for 4 live production projects (and a few toys along the way), 3 of the 4 are on google app engine, and one of the 4 sees a sustained 60 requests a second average, so i've been using it all heavily (though not always the most up to date, i'm slow at incorporating new features). cfh -- http://www.tecnodoc.com.ar
Re: [web2py] Scheduler json string for vars parm
Yes I think the json format is strict to instead of ' change with this and try again: vars='{fromDate:2012-01-01,toDate:2012-01-31,districtNumber:0}', 2012/2/6 Jim Steil j...@qlf.com Hi I'm having trouble getting my vars json string right on my call to add a job to my scheduler. If I run with no vars, it works fine. But, when I add my json string I'm getting: Traceback (most recent call last): File C:\dev\web2py\gluon\**scheduler.py, line 159, in executor vars = loads(task.vars, object_hook=_decode_dict) File C:\dev\web2py\gluon\contrib\**simplejson\__init__.py, line 403, in loads return cls(encoding=encoding, **kw).decode(s) File C:\dev\web2py\gluon\contrib\**simplejson\decoder.py, line 403, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File C:\dev\web2py\gluon\contrib\**simplejson\decoder.py, line 419, in raw_decode obj, end = self.scan_once(s, idx) File C:\dev\web2py\gluon\contrib\**simplejson\scanner.py, line 72, in scan_once return _scan_once(string, idx) File C:\dev\web2py\gluon\contrib\**simplejson\scanner.py, line 43, in _scan_once _scan_once, object_hook, object_pairs_hook, memo) File C:\dev\web2py\gluon\contrib\**simplejson\decoder.py, line 207, in JSONObject raise JSONDecodeError(Expecting property name, s, end) JSONDecodeError: Expecting property name: line 1 column 1 (char 1) My add_task looks like this: db.scheduler_task.insert( status='QUEUED', application_name='myApp', task_name='Task name', function_name='functionname', args='[]', vars={'fromDate':'2012-01-01'**,'toDate':'2012-01-31','** districtNumber':0}, enabled=True, start_time=request.now, stop_time=request.now+**datetime.timedelta(days=1), repeats=1, timeout=600) is there something obvious I'm doing wrong? -Jim -- http://www.tecnodoc.com.ar
[web2py] Book v4.0 translate to spanish
I want to start the translation to spanish of the book, 4th edition. What's are the way to be syncronize with english version?. Any help?.
Re: [web2py] Webfaction account with multiple apps under 1 web2py install
Read: http://web2py.com/books/default/chapter/29/4#URL-rewrite Take a look to the router.py in web2py root folder, to use it you have to rename it to routes.py 1. 2. 3. 4. 5. 6. 7. 8. routers = dict( BASE = dict( domains = { 'domain1.com' : 'app1', 'domain2.com' : 'app2', } ), ) 2012/2/1 Jim Steil j...@qlf.com Hi I've got a couple different apps I want to deploy under my web2py instance on webfaction. Unfortunately, I'm well versed in routing and knowing how to route different requests to different apps. I have different urls that I'd like mapped to different apps. www.application1.com I would like to point to web2py/applications/** application1 www.application2.com I would like to point to web2py/applications/** application2 And, if possible, I prefer to not show the application name in the url - www.application1.com/**application1/controller/**functionhttp://www.application1.com/application1/controller/function Controller and function are fine but would prefer to eliminate the duplicate application1. If there is a spot in the manual I should study harder, please reference it. Unfortunately, I'm relatively weak when it comes to url rewriting/routing and regular expressions. -Jim -- http://www.tecnodoc.com.ar
Re: [web2py] bootstrap 2
jquery ui bootstrap is very nice! 2012/2/1 Bruno Rocha rochacbr...@gmail.com Bootstrap 2 released, full responsible layout! I am working on porting scaffold app to bootstrap with jquery ui support! http://twitter.github.com/bootstrap/download.html http://addyosmani.github.com/jquery-ui-bootstrap/ -- Bruno Rocha [http://rochacbruno.com.br] -- http://www.tecnodoc.com.ar
Re: [web2py] bootstrap 2
tell me if you need help 2012/2/1 Bruno Rocha rochacbr...@gmail.com I am working to port web2py grid layout to use it. and a I have a new feature to grid (sub grids/details forms) experimental I hope to contribute with it very soon On Wed, Feb 1, 2012 at 4:18 PM, Martín Mulone mulone.mar...@gmail.comwrote: jquery ui bootstrap is very nice! 2012/2/1 Bruno Rocha rochacbr...@gmail.com Bootstrap 2 released, full responsible layout! I am working on porting scaffold app to bootstrap with jquery ui support! http://twitter.github.com/bootstrap/download.html http://addyosmani.github.com/jquery-ui-bootstrap/ -- Bruno Rocha [http://rochacbruno.com.br] -- http://www.tecnodoc.com.ar -- Bruno Rocha [http://rochacbruno.com.br] -- http://www.tecnodoc.com.ar
Re: [web2py] Change the case in auth.navbar?
Remember you can do it with css: .auth_navbar a { text-transform:capitalize; } Now I prefer to do my own bar because I think is too long now. I'm using something like this: Unlogged user: Log in | Register. Logged User: Profile | Logout The other things I move it into user.html. So if you want to recover a pass or a user name you have to go to login page. 2012/1/25 naveed w...@naveed.net The navbar for me shows like this: Login | Register | forgot username? | Lost password? The forgot username? is in all lowercase, while the others are in sentence case. What is the cleanest way of making them consistent? Thanks! -- http://www.tecnodoc.com.ar
Re: [web2py] Re: Mixing/supporting CMS with Web2py
I switched the editor of instant press to cleditor. A lightweight and simple WYSIWYG editor. http://premiumsoftware.net/cleditor/ 2012/1/25 Bruno Rocha rochacbr...@gmail.com For those who are looking for inspiration on how to develop a good traditional-cms with web2py, take a look in to http://www.fork-cms.com/before starting your code! -- Bruno Rocha [http://rochacbruno.com.br] -- http://www.tecnodoc.com.ar
Re: [web2py] Re: Movuca - The Social CMS - Need Testers and Contributors
nice bruno, what does it mean movuca? 2012/1/5 Bruno Rocha rochacbr...@gmail.com On Thu, Jan 5, 2012 at 9:27 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Looks really slick This is the basic theme, I am working on two more themes. One based in Foundation and another in twitter bootstrap. It is all modular so its easy to create new themes. -- Bruno Rocha [http://rochacbruno.com.br] -- http://martin.tecnodoc.com.ar
Re: [web2py] Happy new year
late but happy new year! 2012/1/1 Massimo Di Pierro massimo.dipie...@gmail.com Happy new year everybody! -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Strikethrough with MARKMIN
I think is not there, perhaps you can propose or pass extra argument. Warning: I didn't test it. extra = {'strike':lambda text: SPAN(text, style='color:red;text-decoration:line-through').xml()} MARKMIN(text, extra) 2011/12/28 lyn2py lyn...@gmail.com Appreciate answers / urls instead. I found the strikethrough attribute through google. I've searched through the book. MARKMIN doesn't say anything about strikethroughs. Is MARKMIN documentation complete? Or is strikethrough not recommended to use yet? If I understood the source I wouldn't be asking here. On Dec 28, 8:09 pm, Manuele Pesenti manuele.pese...@gmail.com wrote: Il 28/12/2011 07:08, lyn2py ha scritto: How do I strikethrough some text using MARKMIN? It's not available in the book, but I noticed that MARKMIN has a strikethrough attribute. use the source... young Skywalker! :) M. Thanks! -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Strikethrough with MARKMIN
I forget how to use it in content :P `my text`:strike 2011/12/28 Martín Mulone mulone.mar...@gmail.com I think is not there, perhaps you can propose or pass extra argument. Warning: I didn't test it. extra = {'strike':lambda text: SPAN(text, style='color:red;text-decoration:line-through').xml()} MARKMIN(text, extra) 2011/12/28 lyn2py lyn...@gmail.com Appreciate answers / urls instead. I found the strikethrough attribute through google. I've searched through the book. MARKMIN doesn't say anything about strikethroughs. Is MARKMIN documentation complete? Or is strikethrough not recommended to use yet? If I understood the source I wouldn't be asking here. On Dec 28, 8:09 pm, Manuele Pesenti manuele.pese...@gmail.com wrote: Il 28/12/2011 07:08, lyn2py ha scritto: How do I strikethrough some text using MARKMIN? It's not available in the book, but I noticed that MARKMIN has a strikethrough attribute. use the source... young Skywalker! :) M. Thanks! -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Merry christmas
Merry Christmas 2011/12/25 Stefaan Himpe stefaan.hi...@gmail.com Vrolijk kerstfeest en gelukkig nieuwjaar! -- http://martin.tecnodoc.com.ar
[web2py] Instant press 2.1.0 holiday edition (?)
Instant press is not dead, I update it to vesion 2.1.0 holiday edition (?). *What's new?.* Hierarchy pages to menu, now working. Now layout is based in getskeleton. New design. New panel. Fix bugs. Added edit link to page, and articles. Compatibility with new version of web2py. *Info and screenshots.* https://bitbucket.org/mulonemartin/instantpress/wiki/Home *Download* https://bitbucket.org/mulonemartin/instantpress/downloads/instantpress.2.1.0.w2p -- http://martin.tecnodoc.com.ar
Re: [web2py] Instant press 2.1.0 holiday edition (?)
fixed. Sorry, try again. 2011/12/26 Marin Pranjić marin.pran...@gmail.com On Mon, Dec 26, 2011 at 3:21 PM, Martín Mulone mulone.mar...@gmail.comwrote: Instant press is not dead, I update it to vesion 2.1.0 holiday edition (?). *What's new?.* Hierarchy pages to menu, now working. Now layout is based in getskeleton. New design. New panel. Fix bugs. Added edit link to page, and articles. Compatibility with new version of web2py. *Info and screenshots.* https://bitbucket.org/mulonemartin/instantpress/wiki/Home *Download* https://bitbucket.org/mulonemartin/instantpress/downloads/instantpress.2.1.0.w2p -- http://martin.tecnodoc.com.ar ErrorYou do not have access to the wiki. -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Instant press 2.1.0 holiday edition (?)
No, why?. 2011/12/26 Joseph Jude ceph...@gmail.com Looks nice Martin. Isn't routes.py needed to run this? Joseph -- http://martin.tecnodoc.com.ar
Re: [web2py] Instant press 2.1.0 holiday edition (?)
ckeditor, tinyMCE, etc all WYSIWYG web editor are xhtml output. None of the them support markup languages. 2011/12/26 Ovidio Marinho ovidio...@gmail.com Would not it be better to use the CKEditor as to insert photos into a new pageneeds to address in localhost? Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com The Admin password is only showed the first time, when the user is created (because is random generated). Delete all the content inside databases folder. And point again to localhost:8000/app/. You have to see something like this (attached) 2011/12/26 Ovidio Marinho ovidio...@gmail.com Once we enter the administrator password is not shown in the Main Menu Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com fixed. Sorry, try again. 2011/12/26 Marin Pranjić marin.pran...@gmail.com On Mon, Dec 26, 2011 at 3:21 PM, Martín Mulone mulone.mar...@gmail.com wrote: Instant press is not dead, I update it to vesion 2.1.0 holiday edition (?). *What's new?.* Hierarchy pages to menu, now working. Now layout is based in getskeleton. New design. New panel. Fix bugs. Added edit link to page, and articles. Compatibility with new version of web2py. *Info and screenshots.* https://bitbucket.org/mulonemartin/instantpress/wiki/Home *Download* https://bitbucket.org/mulonemartin/instantpress/downloads/instantpress.2.1.0.w2p -- http://martin.tecnodoc.com.ar ErrorYou do not have access to the wiki. -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar
Re: [web2py] Instant press 2.1.0 holiday edition (?)
In articles you have body: the full content of the article, is displayed when you hit readmore. And extract is the portion of content displayed in index or search. You have to fill both. 2011/12/26 Ovidio Marinho ovidio...@gmail.com Revolviendo la discursion del post new Post: no momiento en que se fixa la noticia en Body la primieira viez e en Extarct en primera viez, se tienes en la view principal home la noticia em body e um boton (leia mas) que se lhama a url extract. En segunda viez que actualizo el browse el boton leia mas nao mas se apresenta. Isto es a si miesmo ou ha algo errado.? By the time we type the news we have two choices and body extract, I realized thatwhen we put the first time the news on the main page shows a read more button.But if this update the Browse button does not appear again, this is normal or is something wrong? Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com ckeditor, tinyMCE, etc all WYSIWYG web editor are xhtml output. None of the them support markup languages. 2011/12/26 Ovidio Marinho ovidio...@gmail.com Would not it be better to use the CKEditor as to insert photos into a new pageneeds to address in localhost? Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com The Admin password is only showed the first time, when the user is created (because is random generated). Delete all the content inside databases folder. And point again to localhost:8000/app/. You have to see something like this (attached) 2011/12/26 Ovidio Marinho ovidio...@gmail.com Once we enter the administrator password is not shown in the Main Menu Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com fixed. Sorry, try again. 2011/12/26 Marin Pranjić marin.pran...@gmail.com On Mon, Dec 26, 2011 at 3:21 PM, Martín Mulone mulone.mar...@gmail.com wrote: Instant press is not dead, I update it to vesion 2.1.0 holiday edition (?). *What's new?.* Hierarchy pages to menu, now working. Now layout is based in getskeleton. New design. New panel. Fix bugs. Added edit link to page, and articles. Compatibility with new version of web2py. *Info and screenshots.* https://bitbucket.org/mulonemartin/instantpress/wiki/Home *Download* https://bitbucket.org/mulonemartin/instantpress/downloads/instantpress.2.1.0.w2p -- http://martin.tecnodoc.com.ar ErrorYou do not have access to the wiki. -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Instant press 2.1.0 holiday edition (?)
Any hint or traceback?. 2011/12/26 Alan Etkin spame...@gmail.com Good work Martin. Thanks I tried to load the installer with appadmin on a production server and the server stopped working :/ Anyway, i don't think it is related to instant press issues. By the way, i think the admin access is hard to find in the default view for logged-in users. Maybe it could be emphazised (of course, that is a really small detail) On 26 dic, 16:49, Ovidio Marinho ovidio...@gmail.com wrote: Revolviendo la discursion del post new Post: no momiento en que se fixa la noticia en Body la primieira viez e en Extarct en primera viez, se tienes en la view principal home la noticia em body e um boton (leia mas) que se lhama a url extract. En segunda viez que actualizo el browse el boton leia mas nao mas se apresenta. Isto es a si miesmo ou ha algo errado.? By the time we type the news we have two choices and body extract, I realized thatwhen we put the first time the news on the main page shows a read more button.But if this update the Browse button does not appear again, this is normal or is something wrong? Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com ckeditor, tinyMCE, etc all WYSIWYG web editor are xhtml output. None of the them support markup languages. 2011/12/26 Ovidio Marinho ovidio...@gmail.com Would not it be better to use the CKEditor as to insert photos into a new pageneeds to address in localhost? Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com The Admin password is only showed the first time, when the user is created (because is random generated). Delete all the content inside databases folder. And point again to localhost:8000/app/. You have to see something like this (attached) 2011/12/26 Ovidio Marinho ovidio...@gmail.com Once we enter the administrator password is not shown in the Main Menu Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com fixed. Sorry, try again. 2011/12/26 Marin Pranjić marin.pran...@gmail.com On Mon, Dec 26, 2011 at 3:21 PM, Martín Mulone mulone.mar...@gmail.com wrote: Instant press is not dead, I update it to vesion 2.1.0 holiday edition (?). *What's new?.* Hierarchy pages to menu, now working. Now layout is based in getskeleton. New design. New panel. Fix bugs. Added edit link to page, and articles. Compatibility with new version of web2py. *Info and screenshots.* https://bitbucket.org/mulonemartin/instantpress/wiki/Home *Download* https://bitbucket.org/mulonemartin/instantpress/downloads/instantpres... -- http://martin.tecnodoc.com.ar ErrorYou do not have access to the wiki. -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Instant press 2.1.0 holiday edition (?)
Requirement: you need at least version 1.99.4 Actualizá alan ese web2py es muy viejo. 2011/12/26 Alan Etkin spame...@gmail.com Here is the last error created (after the service was recovered and tried to access instant press app, i am not the server admin and have no access to the system except by the web2py admin interface) web2py™ Version 1.94.6 (2011-03-27 18:20:38) Python Python 2.5.2: /usr/bin/python Traceback Traceback (most recent call last): File /home/web2py/gluon/restricted.py, line 188, in restricted exec ccode in environment File /home/web2py/applications/ipress/models/00main.py, line 18, in module from appsettings import app_settings ImportError: No module named appsettings Regards On 26 dic, 22:43, Martín Mulone mulone.mar...@gmail.com wrote: Any hint or traceback?. 2011/12/26 Alan Etkin spame...@gmail.com Good work Martin. Thanks I tried to load the installer with appadmin on a production server and the server stopped working :/ Anyway, i don't think it is related to instant press issues. By the way, i think the admin access is hard to find in the default view for logged-in users. Maybe it could be emphazised (of course, that is a really small detail) On 26 dic, 16:49, Ovidio Marinho ovidio...@gmail.com wrote: Revolviendo la discursion del post new Post: no momiento en que se fixa la noticia en Body la primieira viez e en Extarct en primera viez, se tienes en la view principal home la noticia em body e um boton (leia mas) que se lhama a url extract. En segunda viez que actualizo el browse el boton leia mas nao mas se apresenta. Isto es a si miesmo ou ha algo errado.? By the time we type the news we have two choices and body extract, I realized thatwhen we put the first time the news on the main page shows a read more button.But if this update the Browse button does not appear again, this is normal or is something wrong? Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com ckeditor, tinyMCE, etc all WYSIWYG web editor are xhtml output. None of the them support markup languages. 2011/12/26 Ovidio Marinho ovidio...@gmail.com Would not it be better to use the CKEditor as to insert photos into a new pageneeds to address in localhost? Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com The Admin password is only showed the first time, when the user is created (because is random generated). Delete all the content inside databases folder. And point again to localhost:8000/app/. You have to see something like this (attached) 2011/12/26 Ovidio Marinho ovidio...@gmail.com Once we enter the administrator password is not shown in the Main Menu Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil Apóio 2011/12/26 Martín Mulone mulone.mar...@gmail.com fixed. Sorry, try again. 2011/12/26 Marin Pranjić marin.pran...@gmail.com On Mon, Dec 26, 2011 at 3:21 PM, Martín Mulone mulone.mar...@gmail.com wrote: Instant press is not dead, I update it to vesion 2.1.0 holiday edition (?). *What's new?.* Hierarchy pages to menu, now working. Now layout is based in getskeleton. New design. New panel. Fix bugs. Added edit link to page, and articles. Compatibility with new version of web2py. *Info and screenshots.* https://bitbucket.org/mulonemartin/instantpress/wiki/Home *Download* https://bitbucket.org/mulonemartin/instantpress/downloads/instantpres. .. -- http://martin.tecnodoc.com.ar ErrorYou do not have access to the wiki. -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: SQLForm.grid - How do I use it properly?
I'm not sure what you want but you can pass args to grid. Like: row_id = request.args[0] query = (db.mytable.id == row_id) table = SQLFORM.grid(query, ... args=request.args, ... ) 2011/12/21 Rahul rahul.dhak...@gmail.com Hi Johann, Here are the details --- I have two tables - I need to grab the id of a contact from first table and use it to update a field status with values as Sent, Request etc. in another table id being the same in both the table. Now in the below code, Send Request is just a button. links = [lambda row: A(SPAN(_class='icon plus'),'Send Request',_class='positive button',_href=URL(default,reqstatus,args=[row.id]))] This code is using the id (row.id) from my contact table which is fine. Now, I want to use this id to send a request (using Send Request button in this grid) through reqstatus function. reqstatus is a separate function in my controller. My problem is how can I use the row.id of this sqlform.grid any particular row and send a status update for a different table using this id. In short i want to use the above [row.id] in a separate function and pass it in a query. How can I achieve it? I hope I am clear this time. Let me know if case you need more details. I checked the below link - but could not get it http://www.mail-archive.com/web2py@googlegroups.com/msg77334.html Thanks, Rahul D (www.flockbird.com - web2py powered) On Dec 20, 6:31 pm, Johann Spies johann.sp...@gmail.com wrote: On 20 December 2011 14:25, Rahul rahul.dhak...@gmail.com wrote: @Johann, below code does not work for me. :( links = [lambda row: A('Edit' , _href = URL('default', 'edit_journal', args = [row.id]))] I used details='False' and it does not show the buttons to me, but shows my custom button only which is what I intended. details = False not details = 'False' That disable the 'View' button. Again for the community - --- I was just wondering if I can use the row.id or any information with sqlform.grid - Below is the link I have defined to show a button called Send Request. I have re-directed it to use a custom function regstatus that passes a row.id argument. ---code--- links = [lambda row: A(SPAN(_class='icon plus'),'Send Request',_class='positive button',_href=URL(default,reqstatus,args=[row.id]))] --- I want to know how can I use the row.id (in above - args=[row.id]) value and use it to make queries considering I want to use this id in my function reqstatus above - Example- I would like to send some request to the record (row id) on which I am say a friend request etc. Can we achieve this? It is still unclear to me what you want to do and what the problem is using row.id. What is 'Send Request'? Maybe if you show your code it will get clearer. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- http://martin.tecnodoc.com.ar
Re: [web2py] Web Development Introduction Based On Web2py
good job marco. 2011/12/21 Khalil KHAMLICHI khamlichi.kha...@gmail.com Looks nice to the eyes, looks interesting to the mind. Keep going. -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: height of selects is narrower than inputs in the new layout
I have a different style but is something like this: After this https://github.com/dhgamache/Skeleton/blob/master/stylesheets/base.css#L327 add: form select, form input[type=file] { height: 30px; } Also think, you have to make a fix for multiple select: select[multiple=multiple] { height: 150px;} 2011/12/19 Massimo Di Pierro massimo.dipie...@gmail.com Me too. Can you send a web2py.css patch? On Dec 19, 3:12 am, puercoespin jzaragoza.puercoes...@gmail.com wrote: Hi, I like very much the new layout of the 1.99.4 version. But in forms, the selects are narrower than inputs. I think there would be equal. -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: date and sum
Use http://tohtml.com/ to highlight the code you want to show 2011/12/4 Rick sababa.sab...@gmail.com I tried to apply the solution to my code, but it still doesn't work. Here is the code: prerecords = db().select(db.day.ALL, orderby=db.day.thedate)for prerecord in prerecords:if prerecord.theauth==auth.user_id: if session.adate==prerecord.thedate: records.append(prerecord) rows = select(records.thedate,records.value.sum(),orderby=records.thedate) for row in rows:print row.records.thedate, row(records.value.sum()) On Dec 5, 3:04 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: rows = db(...).select(db.table.date,db.table.value.sum(),groupby=db.table.date) for row in rows: print row.table.date, row(db.table.value.sum()) mind that 'date' and 'value' are not good field names. Will work with sqlite but will break with other engines. On Dec 4, 8:00 pm, Rick sababa.sab...@gmail.com wrote: Hi, I've a stack of records where records with the same date has different values, eg: record.date[0] = 2011-12-01 record.value[0] = 10 record.date[1] = 2011-12-01 record.value[1] = 20 record.date[3] = 2011-12-02 record.value[3] = 10 And now I want to summarize the values that are recorded for respective date: sumlist.date[0] = 2011-12-01 sumlist.value[0] = 30 sumlist.date[1] = 2011-12-02 sumlist.value[1] = 10 I suppose I should use filter and sum, but I don't know how. Any ideas? Thanks in advance for help! -- http://martin.tecnodoc.com.ar
Re: [web2py] Is this a in custom imports?
Interesting, there is some trouble but I coudn't see it. 2011/12/4 Constantine Vasil thst...@gmail.com I managed to transfer a very big app initially developed for Django+GAE+JQuery Mobile to web2py. Managed to set up my Eclipse environment to work with web2py and now I can debug my web2py + GAE hybrid app. Works excellent. The issues I see is because my app is big it runs slower than on my former configuration. After extensive debugging I see web2py executes in every request the .py files in models folder. Because there are a lot of table definitions this slows down execution considerably. Researching what to do I found the following article very useful: Optimize your web2py app using the new import method http://martin.tecnodoc.com.ar/default/tag?name=import Then I learned about custom imports. I found the following bug in the example above: In def define_auth(self): db.auth_user.first_name.writable = db.auth_user.first_name.readable = False db.auth_user.last_name.writable = db.auth_user.last_name.readable =False auth.messages.verify_password_comment = '' does not works, but works in init_auth after self.auth_def() #the auth definition Is this is bug in web2py? Regards, --Constantine -- http://martin.tecnodoc.com.ar
Re: [web2py] Is this a in custom imports?
Interesting I have this working without passing the self parameter, anyways this is an old code I update this code a lot. And yes is not need to use a defined auth you can remove it. 2011/12/5 Anthony abasta...@gmail.com Why do you do: self.auth_def = lambda: self.define_auth Anyway, that won't work as expected, because your lambda returns a function instead of calling the function. Also, you might need to add the 'self' parameter to the lambda. Maybe: self.auth_def = lambda self: self.define_auth() But again, what is the purpose of that? Anthony On Monday, December 5, 2011 11:24:18 AM UTC-5, Constantine Vasil wrote: the only way to see it is to recreate the project. Custom imports solves a real speed issue and everything will work much faster so it is worth to do it. But this issue should be resolved. Because the debugger cannot be used it is very hard to detect. I mentioned it because i wanted to hide the first, last name and the password comment from register page the usual way, but they continued to show up. Wondering what gives, I moved these setting in *init_auth** *and now it works as expected. So I believe in def *init_auth*(self), this statement self.*auth_def*() #the auth definition does not executes at all. -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Registration Using Auth
yes but be aware with this code anyone can register as an admin. 2011/12/2 Massimo Di Pierro massimo.dipie...@gmail.com def register_in_group(): group_id = request.args(0) auth.settings.register_onaccept=lambda form: auth.add_membership(group_id,form.vars.id) form = auth.register() return dict(form=form) then call http://.../register_in_group/2 On Dec 2, 9:24 am, lyn2py lyn...@gmail.com wrote: Hello, I would like to assign a group on the form where a user registers. For example: Student group Teacher group Admin group Finance group How do I create different registration forms for each user group, so that the users sign themselves up and are assigned the specific group? I'm thinking that this should be quite easily done in web2py, but I couldn't find the answer it the book. I was looking for the answer in Access Control ( http://web2py.com/book/default/chapter/08 ). Thanks! -- http://martin.tecnodoc.com.ar
Re: [web2py] Say hello to i-Track
Very nice julio. Is the trac in web2py. 2011/12/1 Julio Schwarzbeck ju...@techfuel.net Folks, I've just released i-Trac i-Track is a simple issue/bug tracking system developed in web2py, it is Open Source Software released under the Simplified BSD License, the site is live at: http://www.i-track.org/ There is a demo site also at http://demo.i-track.org/ feel free to use to test the system if you wish, instructions on how to log in in the demo site are posted in there. i-Track is already fully functional and even has a couple of bugs posted for itself (eating our own dog food of course). If you wish to help develop or contribute to post bugs or issued, please create an account in the regular 'www' site, instructions on how to do and what to expect are also posted in the main homepage. Code is hosted in bitbucket (link at the footer of the website) in case you wish to get your own copy. Happy testing/posting/hacking Julio FS (Speedbird) -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: web2py logo and layout has changed one year ago...
Another logo contest is comming?... :) 2011/12/1 Massimo Di Pierro massimo.dipie...@gmail.com I do not like names that have google search conflicts. Others like that because their search results go up. We had a different name and I was threatened to be sued. I spend $500 to trademark web2py. Can anybody find a better name that has no search conflicts, is not trademarked, and is willing to donate $500? It does take time and effort in building a brand and we are succeeded. We should not start again. We can give animal names to various stable version if you like. Massimo On Nov 30, 9:46 am, Omi Chiba ochib...@gmail.com wrote: I love the framework but hate the name Web2py Honestly, I agree. Django sounds cool but not web2py. I like gluon better :) On Nov 30, 9:16 am, António Ramos ramstei...@gmail.com wrote: I love the framework but hate the name Web2py Everyone uses names related to animals, objects,etc. At least it gives a better change for a nice logo. Best regards 2011/11/30 stefaan stefaan.hi...@gmail.com Web2py default layouts certainly have come a long way since the (IMHO, quite awful :p ) fluorescent orange and black-green looks. I do seem to miss some best-practices documentation about how to effectively apply themes to a web2py application. The downloadable themes do not always properly display the newer widgets (like sqlform.grid), leaving me (as a css nitwit) not much option but to use the default layout. Unlike web2py functionality, the css classes do not seem to be kept backward compatible (your layout won't be overwritten if you upgrade to a newer web2py, but if you want the newer features to render properly you may have to manually merge old layouts with newer layouts) handwaving I'm wondering if there aren't any WYSIWYM web layout solutions (what- you-see-is-what-you-mean, a web equivalent to LaTeX macros for printable documents), e.g. providing standardized css classes that all scaffolding applications/widgets/user views ought to restrict themselves to. Themes would also have to be implemented in terms of those standardized css classes, hopefully leading to a smoother theming experience. Approaches like the ui argument in sqlform.grid do not seem ideal to me. /handwaving -- http://martin.tecnodoc.com.ar
Re: [web2py] Relative path in css for @font-face embedding
relative url in css have to work, have nothing to do with web2py. My files are: static/css/myfont.eot static/css/layout.css My def: src: url('myfont.eot'); My files are: static/css/fonts/myfont.eot static/css/layout.css My def: src: url('fonts/myfont.eot'); 2011/11/30 monotasker scotti...@gmail.com I'm trying to use an embedded font referenced in a stylesheet. The only url that seems to work in the @font-face declaration (in my css file) is one that begins with the appname: /[appname]/static/[font folder]. It seems, though, like I can't generate the URL programmatically (with the URL helper) in the css file. So is there a relative address that will work? It just occurred to me that the problem might be my use of the less.js css processing script. Could the URL helper not be working because it conflicts somehow with less.js? -- http://martin.tecnodoc.com.ar
Re: [web2py] Relative path in css for @font-face embedding
I'm not sure, what do you want to do?, or why do you need to include app path?. But you can also make it this in the view to make use of URL() in the view or layout include the tag style simil to this: style type=text/css ... @font-face { src: url('{{=URL('static','myfont.eot')}}'); } /style 2011/11/30 monotasker scotti...@gmail.com I'll try these again. So far they didn't seem to work for me. -- http://martin.tecnodoc.com.ar
Re: [web2py] Error in custom_import and Pyforum
I think you need json module installed on your system. You are under windows, linux, ?. In ubuntu linux you can install it from console doing: apt-get install python-simplejson 2011/11/27 mikech mp.ch...@gmail.com Hi: I downloaded Pyforums in order to study some code in what looks like a very well done application. When I try to look at the default index view I get the following error: 1. 2. 3. 4. 5. 6. 7. Traceback (most recent call last): File gluon/restricted.py, line 194, in restricted File C:\web2py\applications\pyforum\controllers/default.py, line 6, in module File gluon/custom_import.py, line 294, in __call__ File gluon/custom_import.py, line 78, in __call__ ImportError: No module named json Running Version 1.99.2 (2011-09-26 06:55:33) stable -- http://martin.tecnodoc.com.ar
Re: [web2py] Error using LOAD in custom module
try something like this from gluon.compileapp import LoadFactory def renderimages(self, page=1, postid=0): Render Images curvars = {} curvars['page']=page curvars['postid']=postid environment = {} environment['request'] = current.request environment['response'] = current.response LOAD = LoadFactory(environment) return LOAD(self.controller_name, 'imageslist.html', vars=curvars, ajax=True) 2011/11/25 monotasker scotti...@gmail.com Hmmm ... Those don't seem to be working. from gluon import LOAD This doesn't seem to import anything. PyDev tells me that there's an unresolved import Still get the 'NoneType not callable' error. from gluon import current LOAD = current.LOAD I get AttributeError: 'thread._local' object has no attribute 'LOAD' -- http://martin.tecnodoc.com.ar
Re: [web2py] problem with scheduler
I think repeats=0 is not working, try with another value like 999, 99 2011/11/21 Manuele manuele.pese...@gmail.com ** Hi, I'm using web2py version 1.99.2 with the new scheduler. I have a scheduled function that is run once a day at the same time with this parameters: Start Time: 2011-11-10 01:30:00 Next Run Time: 2011-11-22 01:30:00 Stop Time:2020-01-01 00:00:00 Repeats:0 Period:86400seconds Timeout:3600seconds Times Run:... Last Run Time:... it happens that when something wrong happens (like crash or application is killed by kernel) when I restart the application the next run time is changed in the time part and the function is not performed at the same hour I planned... so I have to change by hand every time that it happens. Is it a strange behavior? thanks Manuele -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: sqlform.grid
You can't pass vars, you have to use args instead. I think we need to find a solution to this. 2011/11/8 JmiXIII sylvn.p...@gmail.com Sorry I open a new discussion -- http://martin.tecnodoc.com.ar
Re: [web2py] NInja IDE 2.0b and Plugin contest
I'm using too and is great. 2011/10/26 Bruno Rocha rochacbr...@gmail.com NInja IDE released 2.0b and it is awesome! (http://www.ninja-ide.org/) They are running a plugin contest http://www.ninja-ide.org/plugins/ Any taker to create a web2py plugin? What features do people think a web2py plugin for Ninja-IDE should have? -- Bruno Rocha [http://rochacbruno.com.br] -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: SOLVED join and sum - display in view
I think is row['sum'] 2011/10/21 andrej burja andrej.bu...@gmail.com with row[sum] it doesn't work type 'exceptions.KeyError'('built-in function sum') Actually, the above will only work if the controller returns 'sum' in the dictionary -- otherwise it will be undefined in the view. what shoul i change in the controller? -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Specifying Fields in Grid
yes, but you can use columns instead of fields. 2011/10/21 horridohobbyist horrido.hobb...@gmail.com No, but I don't want to display the id. Is this mandatory? Richard On Oct 21, 1:35 pm, Nate Atkinson nja.perso...@gmail.com wrote: Have you tried including db.products.id in the fields? On Oct 21, 1:30 pm, horridohobbyist horrido.hobb...@gmail.com wrote: I'm trying to specify exactly which fields to display in a grid, but I just can't get the syntax right. And the docs are of no help. Here's what I tried, among other things: SQLFORM.grid(db.products,deletable=False,editable=False,create=False,csv=Fa lse,searchable=False,details=False,maxtextlength=100,fields=[ db.products.na me,db.products.description,db.products.price]) No matter what I put into fields=, I keep getting an error. What is the correct syntax, please? Thanks, Richard -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Specifying Fields in Grid
which version of web2py?. was a bug .. update to last from trunk or pass like string: columns = ['products.description'] 2011/10/21 horridohobbyist horrido.hobb...@gmail.com I tried columns, but it just seems to be ignored. Richard On Oct 21, 1:48 pm, Martín Mulone mulone.mar...@gmail.com wrote: yes, but you can use columns instead of fields. 2011/10/21 horridohobbyist horrido.hobb...@gmail.com No, but I don't want to display the id. Is this mandatory? Richard On Oct 21, 1:35 pm, Nate Atkinson nja.perso...@gmail.com wrote: Have you tried including db.products.id in the fields? On Oct 21, 1:30 pm, horridohobbyist horrido.hobb...@gmail.com wrote: I'm trying to specify exactly which fields to display in a grid, but I just can't get the syntax right. And the docs are of no help. Here's what I tried, among other things: SQLFORM.grid(db.products,deletable=False,editable=False,create=False,csv=Fa lse,searchable=False,details=False,maxtextlength=100,fields=[ db.products.na me,db.products.description,db.products.price]) No matter what I put into fields=, I keep getting an error. What is the correct syntax, please? Thanks, Richard -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: join and sum - display in view
FROM THE BOOK Previously, you have used the count operator to count records. Similarly, you can use the sum operator to add (sum) the values of a specific field from a group of records. As in the case of count, the result of a sum is retrieved via the store object: 1. 2. 3. sum = db.log.severity.sum() print db().select(sum).first()[sum] 6 Expression can be combined to form more complex expressions. For example here we are computing the sum of the length of all the servery strings in the logs, increased of one: 1. 2. sum = (db.log.severity.len()+1).sum() print db().select(sum).first()[sum] 2011/10/20 Anthony abasta...@gmail.com Wait, do you mean that you did the sum as part of the select? What exactly did you return to the view (the whole Rows object), and how do you want to display the results? In general, you would access the sum field like rows[row_number]['SUM(t_table.f_field)']. Note, you can also assign the sum to a variable prior to the select and then use the variable name to access the sum from the Rows object -- see http://web2py.com/book/default/chapter/06#belongs (sum is discussed right after belongs). On Thursday, October 20, 2011 1:27:02 AM UTC-4, andrej burja wrote: in controler i do join and sum the result si rows object in response._vars the sum is displayed in SUM(t_table.f_field) what is the syntax to display that in view? andrej -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: grid custom button icons
ui = dict(widget='ui-widget', header='ui-widget-header', content='ui-widget-content', default='ui-state-default', cornerall='ui-corner-all', cornertop='ui-corner-top', cornerbottom='ui-corner-bottom', button='ui-button-text-icon-primary', buttontext='ui-button-text', buttonadd='ui-icon ui-icon-plusthick', buttonback='ui-icon ui-icon-arrowreturnthick-1-w', buttonexport='ui-icon ui-icon-transferthick-e-w', buttondelete='ui-icon ui-icon-trash', buttonedit='ui-icon ui-icon-pencil', buttontable='ui-icon ui-icon-triangle-1-e', buttonview='ui-icon ui-icon-zoomin', ) SQLFORM.grid(... ui=ui) or default definition: ui = dict(widget='', header='', content='', default='', cornerall='', cornertop='', cornerbottom='', button='button', buttontext='buttontext button', buttonadd='icon plus', buttonback='icon leftarrow', buttonexport='icon downarrow', buttondelete='icon trash', buttonedit='icon pen', buttontable='icon rightarrow', buttonview='icon magnifier', ) this is are css class name, take a look to static/base.css 2011/10/19 Nik Go nikolai...@gmail.com *bump* On Tuesday, October 18, 2011, Nik Go wrote: how do I specify the other icons available from the default icon sprite? -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: table, grid, smartgrid, getting better
I think buttons are under T(), fill a ticket perhaps some are missing 2011/10/18 Tito Garrido titogarr...@gmail.com Is there a way to translate the buttons and etc? Is there any documentation about smartgrid? This thread is so big... it complicated to follow it... Regards, Tito On Mon, Oct 3, 2011 at 4:49 PM, Phyo Arkar phyo.arkarl...@gmail.comwrote: Very nice work ongoing .. Only sad thing is i am moving into Qooxdoo framework and am getting more and more into it , i am not going to be able to use any of smartgrid .. It have an excellent Table with well written remote model. Hope i can use in web2py way, On 10/4/11, Jim Steil j...@qlf.com wrote: This didn't work for me, but maybe I'm applying it in the wrong spot. My controller is: @auth.requires_login() def members(): response.view = 'list.html' columns = ['member.firstName', 'member.lastName', 'member.city', 'member.state', 'member.phone', 'member.joinedOn', 'memberCampaign.campaignId', 'memberCampaign.amount', 'memberCampaign.paidOn', 'memberTag.tagId'] db.memberCampaign._plural = 'Campaigns' grid = SQLFORM.smartgrid(db.member, columns=columns, details=False, ui='jquery-ui', csv=False) return dict(grid=grid) Running this I get: Traceback (most recent call last): File C:\dev\web2py\gluon\restricted.py, line 194, in restricted exec ccode in environment File C:/dev/web2py/applications/dalc/controllers/default.py, line 118, in module File C:\dev\web2py\gluon\globals.py, line 149, in lambda self._caller = lambda f: f() File C:\dev\web2py\gluon\tools.py, line 2467, in f return action(*a, **b) File C:/dev/web2py/applications/dalc/controllers/default.py, line 100, in members db.memberCampaign._plural = 'Campaigns' File C:\dev\web2py\gluon\dal.py, line 4981, in __setattr__ raise SyntaxError, 'Object exists and cannot be redefined: %s' % key SyntaxError: Object exists and cannot be redefined: _plural Just created my environment from trunk. Thoughts? -Jim On 10/3/2011 12:59 PM, Massimo Di Pierro wrote: On Oct 3, 5:07 am, andrej burjaandrej.bu...@gmail.com wrote: hi how could i add a sum in the linked table? i have person, linked table payments. Opening the payments table from person table, displaying only payments from that person, i would like to display the sum for that person. How can i do that? That's a good idea for a new feature. Please open a ticket and how to change the label on button 't_payments'? db.t_payments._plural = 'My Payments' # requires trunk andrej -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___ -- http://martin.tecnodoc.com.ar
Re: [web2py] _href and user signature
Why do you need to pass a signature?. If it's in another controller put the authorization decorator and link as normal. If its in the same controller you only can pass args. 2011/10/19 Nik Go nikolai...@gmail.com In a smartgrid, I'm trying to generate a clickable link to view another records. How do I pass the signature? -- http://martin.tecnodoc.com.ar
Re: [web2py] grid usage
at the moment you can't pass vars to grid, instead use args. 2011/10/19 Manuele manuele.pese...@gmail.com On 19/10/2011 13:49, brushek wrote: Hello, I want to use SQLFORM.grid in one controller like this: def klienci(): if request.vars.a == 'adresacje': grid=SQLFORM.grid(db.**adresacje,user_signature=**False) elif request.vars.a == 'serwery' or 'serwery' in request.args: grid=SQLFORM.grid(db.serwery,**user_signature=False) elif request.vars.a == 'klienci': grid=SQLFORM.grid(db.klienci,**user_signature=False) return dict(grid=grid) the problem is that the controller is reloaded when you click on grid command as edit or new page but the variable a is no more posted to the page... why not to use different controllers?? it's surely the easiest way Manuele Form is showing, but when I click on edit (or enything else action) I get following error: Traceback (most recent call last): File /home/users/brushek/web2py/**gluon/restricted.py, line 192, in restricted exec ccode in environment File /home/users/brushek/web2py/**applications/staty/**controllers/ default.py, line 135, inmodule File /home/users/brushek/web2py/**gluon/globals.py, line 149, in lambda self._caller = lambda f: f() File /home/users/brushek/web2py/**applications/staty/**controllers/ default.py, line 92, in klienci return dict(grid=grid) UnboundLocalError: local variable 'grid' referenced before assignment How to use grid with vars ? Do I need to make diffrent controllers/ views to use grid ? regards brushek -- http://martin.tecnodoc.com.ar
Re: [web2py] new scheduler options quest
take a look to this app: https://bitbucket.org/mulonemartin/scheduler/src 2011/10/18 Manuele manuele.pese...@gmail.com I would try to use the new scheduler so I've seen the video how to by mdp, now I want to apply the scheduler on my needs but the options are not so clear, I expected they more reflect the crontab syntax but maybe they reflect a simpler way of thinking I can't figure out :) what if I want to run a function once a day at the same time? I thought to specify thees options as follows is it right? Start time: current as suggested by default Next Run Time: same day as Start at the time I expect the function will be run Repeats: 1 Period: 64800 Timeout: 3600 -- http://martin.tecnodoc.com.ar
Re: [web2py] Some say local_import is deprecated. Is it?
http://www.slideshare.net/martinpm/web2py-pensando-en-grande-9448110 slides from 13 to 20. 2011/10/14 Bruno Rocha rochacbr...@gmail.com the custom_importer is implemented in a transpatent way. you only have to use normal imports. from module import object this has adittional feature to track changes in modules. track_changes() I guess it is not doccumented yet. http://zerp.ly/rochacbruno Em 14/10/2011 14:45, Vinicius Assef vinicius...@gmail.com escreveu: Where is the nem import system documented or where can we know more details about it? On Fri, Oct 14, 2011 at 3:24 AM, Bruno Rocha rochacbr...@gmail.com wrote: It is still supported and should work, but it is deprecated and encouraged to use the new import system On Fri, Oct 14, 2011 at 3:22 AM, seongjoo seongjoo@gmail.com wrote: While solving some problems of importing module, I found a web article that contains some argument saying that local_import is deprecated. http://comments.gmane.org/gmane.comp.python.web2py/67885 The web2py book (ed 3.1) has no mention about local_import being deprecated, so I would like to know it is or it is not. -- -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ] [ Aprenda a programar: http://CursoDePython.com.br ] [ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br] [ Consultoria em desenvolvimento web: http://www.blouweb.com ] -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Tag handling suggestions
In my opinion I'll discard option number 1 if you are not running on GAE. Because is not a true SQL, is quite awfull indeed, bring it by nosql gae. But it's all depends on the amount of records. 2011/10/10 Bruno Rocha rochacbr...@gmail.com I like this, and it is really smarter than list:string option, but, imagine a blog where users include tags in an INPUT text field, this will be more difficult to store tags in other table (you can do using ajax or building a checkbox list of tags) but it is easy just to let the user put tags in a text field comma separated or space sepated, then split and store in list:string field. -- http://martin.tecnodoc.com.ar
Re: [web2py] mailing list and web2py apps
I'm considering number eleven :P 2011/9/23 Bruno Rocha rochacbr...@gmail.com I Guess there is no list policy, but I recommend this order. 0. Perform a search on group trying to find people running same issue 1. Try to contact the Author of the app directly 2. Try to find some contact, forum, blog, discussion, repository if the app 3. Post your issue here in the group 4. Bump UP your own post if not answered for some time, (sometimes people just dont get it, too many posts) 5. Try to solve yourself and contribute with the author 7. Create a voodoo of the app author :P 8. sit down and cry 9. forget about the app, try to find other solution 10. develop your own version based on a fork 11. Forget about web development and try to find another job! LOL 12. It was serious until the option n. 5 On Fri, Sep 23, 2011 at 5:13 AM, Gour-Gadadhara Dasa g...@atmarama.netwrote: Hello! I'd not like to hijack this mailing list with the posts about issues with web2pyapps if it's not meant for that, so what is the lists' policy about it? Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 -- -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ] [ Aprenda a programar: http://CursoDePython.com.br ] [ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ] [ Consultoria em desenvolvimento web: http://www.blouweb.com ] -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: smartgrid: can we add field type class on th, td in web2py_table ?
I'm not sure if this work cause I didn't test it, but did you tried with represent?. something like this: db.mytable.price.represent = lambda price, row: XML(DIV(price,_style='text-align: right;')) 2011/9/28 Willoughby neil.erik...@gmail.com The first thing my boss said when I demonstrated the new SMARTGRID was 'Why are all the numbers aligned to the left? I haven't dug into it yet so I'm hoping someone has an easy CSS fix or something...I'm way out of my element here... -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: web2py with twitter bootstrap - very clean interface ...
it looks amazing. talk is cheap show me the code :P 2011/9/26 Bruno Rocha rochacbr...@gmail.com We are planning to include it in the next web2py version. I will share the actual w2p after a clean up. http://zerp.ly/rochacbruno Em 26/09/2011 17:36, Matt Gorecki m...@goelephant.com escreveu: This is excellent. Would you mind sharing your layout.html? -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: web2py slides from pycon argentina (spanish)
Try to use the example from this slide, I work every day with modules using the slide method, The post is too old, and I have re read. 2011/9/24 pbreit pbreitenb...@gmail.com Martin, I'm curious about structuring a new app using the new importing and modules. I read your blog post: http://martin.tecnodoc.com.ar/default/post/2011/09/12/7_optimize-your-web2py-app-using-the-new-import-method Which is very helpful but I couldn't get it to work. I suspect the simpleapp.zip download would help but it's broken: http://martin.tecnodoc.com.ar/static/others/simpleapp.zip Thanks for any help. -- http://martin.tecnodoc.com.ar
Re: [web2py] instant press: pingback support?
At the moment, no. 2011/9/22 Gour-Gadadhara Dasa g...@atmarama.net Hello! Does Instant Press have support for pingback? Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Smartgrid/grid anomaly
this is wrong is not the same as field notation: columns = [db.akb_doccenter.title, db.akb_doccenter.author, db.akb_doccenter.publication_date, db.akb_doccenter.doc_nr, db.akb_doccenter.location, db.akb_doccenter.id] must be: columns = ['akb_doccenter.title', 'akb_doccenter.author' ...] 2011/9/21 Johann Spies johann.sp...@gmail.com On 21 September 2011 14:45, Johann Spies johann.sp...@gmail.com wrote: query = db(db.akb_doccenter.id 0) Is that a bug in my code or in the trunk? The bug was in my code: it should be : query=(db.akb_doccenter.id0) Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence. 2 Pet. 1:2b,3a -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Applications sharing auth tables - problem
Please if it's a bug: Open a ticket. 2011/9/21 Anthony abasta...@gmail.com Yes, the loop seems to happen when you have a custom auth_user table (even if it's exactly the same as the standard auth_user table definition). Anthony On Wednesday, September 21, 2011 7:20:54 PM UTC-4, rochacbruno wrote: On Wed, Sep 21, 2011 at 7:01 PM, Massimo Di Pierro massimo@gmail.com wrote: I am not aware of a CAS bug? tell us more. Look this thread: https://groups.google.**com/forum/#!topic/web2py/** FhtokyNZT7k/discussionhttps://groups.google.com/forum/#!topic/web2py/FhtokyNZT7k/discussion CAS enters in redirect loop. -- http://martin.tecnodoc.com.ar
Re: [web2py] what about web2py 2.0?
Yes 2.0 we have to make it big. 2011/9/20 Sebastian E. Ovide sebastian.ov...@gmail.com +1 for breaking compatibility (in a major version) a remove obsolete features,,, On Tue, Sep 20, 2011 at 9:26 AM, Mengu whalb...@gmail.com wrote: anything special coming up? will it broke backward compatibility? nobody needs backward compatibility in a major version. are there any plans for a clean up? -- Sebastian E. Ovide -- http://martin.tecnodoc.com.ar
Re: [web2py] I did not know one could do this with css
Massimo to add fonts support we have to think how to resolve the problem to add css to files that not have the .css extension. 2011/9/19 Massimo Di Pierro massimo.dipie...@gmail.com http://use.fontorie.com/ How about an app? -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Instant Press 2.0
CKeditor as a default editor not for now. But let me think if we can add as optional. CKeditor is heavy, slow, too much. The editor included is fast lightweight, and support multiples markup languages. I included textile support because can handle chained list that markmin can't. 2011/9/14 Gour-Gadadhara Dasa g...@atmarama.net On Tue, 13 Sep 2011 15:17:44 -0700 (PDT) Anthony abasta...@gmail.com wrote: I think Instant Press 1.0 included CKEditor -- have you thought about offering that as an option in Instant Press 2.0 as well? Although it would be nice to have CKEditor included, I wonder about different markup support? On video I see it's present and web page says: CMS content: Edit in markup language. Supported: Markmin, Html, Markdown, Textile. but I am, somehow, missing it? Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: Instant Press 2.0
Isn't the one of them obsolete/redundant? Yes I know, perhaps... but, what I want is to have in content, an space to edit the text, without extra fields noising the enviroment. 2011/9/14 Gour-Gadadhara Dasa g...@atmarama.net On Wed, 14 Sep 2011 07:33:35 -0300 Martín Mulone mulone.mar...@gmail.com wrote: CKeditor as a default editor not for now. But let me think if we can add as optional. CKeditor is heavy, slow, too much. The editor included is fast lightweight, and support multiples markup languages. I included textile support because can handle chained list that markmin can't. Personally I'd like to use Markdwon (I suppose it's richer than markimin), but I do not see any option to select some markup as it is seen on the video? Do I miss something? p.s. Ahh...When I added new page and displayed its info, I saw it's in 'markmin markup' and then after selecting 'Content' I could see dropbox to select markdown. So, my conclusion is that having both 'Edit' 'Content' is a bit confusing? Isn't the one of them obsolete/redundant? Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: SQLFORM.grid representation
Perhaps you want to use columns instead of fields. replace your controller with this: def index(): columns = ['dog.name', 'dog.owner'] table = SQLFORM.grid(db.dog, columns=columns) return dict(table=table) columns affect the grid column displaying only. Pass to column the field you want to display, no need to put readable=False. 2011/9/14 Simon Ashley gregs...@gmail.com While it could be a bug, and seems to be similar to another reported issue: http://groups.google.com/group/web2py/browse_thread/thread/aa5fa98a74e9364f# there has been no formal acknowledgement of it in .grid or .smartgrid, nor have there been any defect tickets raised. You can also see it in a screenshot that Bruno Rocha posted recently: http://www.diigo.com/item/image/121xl/3iob It leads me to think that there may be an alternative method, particularly when 1.99.1. is due shortly. Cheers, (apologies if there are a number of similar posts from me. The first 2 seemed to be accepted, but haven't appeared yet. This is posted using a different account) On Sep 14, 12:11 am, Jim Steil j...@qlf.com wrote: Is it possible that this is a bug? (I don't have the expertise/confidence to say it is definitely a bug).I duplicated your example and can reproduce your results. But, if I go through appadmin and list out my table the owner name does appear. -Jim On 9/12/2011 9:51 PM, Simon Ashley wrote: Have a Model as follows: from gluon.tools import Auth auth=Auth(db) auth.define_tables() db.define_table('person',Field('name'),format='%(name)s') db.define_table('dog',Field('name'),Field('owner',db.person)) db.dog.owner.requires = IS_IN_DB(db, 'person.id', db.person._format) and a controller: def index(): db.dog.id.readable=False fields = (db.dog.id, db.dog.name, db.dog.owner) table = SQLFORM.grid(db.dog, fields) return dict(table=table) Main issue: the grid returns the id rather than the name for the owner. Edit and view both return the name (as expected). Is there a problem with the model/ controller syntax? Side issue: In the controller, fields line, if db.dog.id is left out, the grid returns an id ticket error. Traceback (most recent call last): File gluon/restricted.py, line 194, in restricted File C:/web2py/applications/pt2/controllers/dogs.py, line 7, in module File gluon/globals.py, line 145, inlambda File C:/web2py/applications/pt2/controllers/dogs.py, line 4, in index File gluon/sqlhtml.py, line 1647, in grid File gluon/dal.py, line 3835, in __getitem__ KeyError: 'id' This occurs with or without the second line (... readable=False) commented out. Wanted to show the id in edit and view forms but not in the grid. Can this be achieved? -- http://martin.tecnodoc.com.ar
Re: [web2py] Re: If you have not followed recent changes .....
Boolean values are also given in numbers instead of checkboxes, or simply 'Yes' / 'No': please open a ticket. 2011/9/14 Ross Peoples ross.peop...@gmail.com I have tried this using a new app, no jQuery UI or anything yet, just stock welcome app. I have a couple of issues. First in the list, it only shows the index numbers instead of the auth.user representation. Boolean values are also given in numbers instead of checkboxes, or simply 'Yes' / 'No': https://lh4.googleusercontent.com/-_ErLdMwFqDc/TnCZQWMiXVI/AEY/fNZ0T_mSxpc/Screen%252520Shot%2525202011-09-14%252520at%2525208.05.23%252520AM.png In the add window, this is what it looks like: https://lh4.googleusercontent.com/-916Yer1ejIg/TnCZzdZKOdI/AEg/MghexpfLdIM/Screen%252520Shot%2525202011-09-14%252520at%2525208.05.35%252520AM.png The first thing I noticed was the lack of a border below the Back button. The second thing is I don't know that the Back button's icon is. Is it supposed to be a door, a book, or what? Can we change that to use something more standard, like a left arrow or something? Other than the things I mentioned, this is looking really good! Nice work everyone! -- http://martin.tecnodoc.com.ar
Re: [web2py] SQLFORM grid and smartgrid
2. Can I override the default links for Add and Edit? links = [lambda row: A('Edit',_href=URL(default,edit,args=[row.id])), lambda row: A('Delete',_href=URL(default,delete,args=[row.id]))] table = SQLFORM.grid(query, links=links, deletable=False, editable=False, create=False ) 2011/9/14 Jim Steil j...@qlf.com I understand that these two grid are brand new, but has anyone created any documentation on all of the options and how to use them yet? Here are a couple issues I'm wondering about: 1. In reading this post - https://groups.google.com/**forum/#!msg/web2py/ **1eSMh8TlHGs/rB9Hx2UIP4cJhttps://groups.google.com/forum/#!msg/web2py/1eSMh8TlHGs/rB9Hx2UIP4cJ- and looking at the images provided, how do I get the buttons to display instead of just link text. 2. Can I override the default links for Add and Edit? 3. What is the difference between grid and smartgrid? I'm happy to proof/test any documentation that is in progress. I'm just eager to get to work with these great new tools. -Jim -- http://martin.tecnodoc.com.ar
Re: [web2py] Instant Press 2.0
I notice that the old editor had image upload feature, this will not be included in this version? take a look to: http://www.youtube.com/watch?v=vGkR246URRkfeature=player_detailpage#t=200s Yes only in content (post/ page) 2011/9/14 Bruno Rocha rochacbr...@gmail.com I notice that the old editor had image upload feature, this will not be included in this version? May be could have a simpler way to detect the presence of a plugin for editor, so users can decide which HTMl editor to use I am using http://dev.s-cubism.com/plugin_elrte_widget and I like it, so certainly I will try to integrate it with instant press to be used in my personal website. Thanks again Martin! -- http://martin.tecnodoc.com.ar