[web2py] priority of web2py CMS
Hello! In the middle of November Massimo wrote: this will be the top priority after web2py 2.0 is released and the book 4th edition. By the end of November. in regard to working on some decent CMS for web2py. Due to some other engagements, I was not following the group closely, but afaict, the book is released, but there is no web2py 2.0. In the meantime there was InstantPress-2.1 release, but based on my experience when reporting some bug, it took quite some time to be fixed (~2 months), so I guess that the only developer (there are no forks @bitbucket) is probably occupied with other engagements and IP is not his main focus and we gave up on it. Now I also see there is new project Movuca - Social CMS, but our needs are more in the category of 'classical' CMS wahtever it means (we've already discussed it a lot here). So, the question remains if the above statement is still relevant and there is a desire to work on one complete web2py-powered CMS-framework or is it that web2py community is simply more interested for other web-related applications? Nothing wrong with that, just to be sure where to put our present focus. (We, anyway, have to fiddle with PHP Concrete5 at the moment.) btw, what's preventing 2.0 release? Sincerely, Gour -- One who restrains the senses of action but whose mind dwells on sense objects certainly deludes himself and is called a pretender. http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 signature.asc Description: PGP signature
Re: [web2py] Re: Cherrypy can run on android ! without any patching needed , Can Rocket do that?
web2py runs on Android - I've tested it with my Motorola Defy. The only problems, I discovered until now concerns the cache: 1. gluon/cache.py uses the python standard library shelve. And shelve on Android uses dumbdbm instead of anydbm as normally on unix systems, this leads to problems in creating new database files for caching - in web2py therefor in creating applications. I solved this with a short workaround of cache.py (see attachment) and a default cache-archive (see attachment). This is still a workaround, because this problem should be solved by shelve in the standard library and not by web2py ! The attachments can be found on my server: http://klever.hs-augsburg.de/Veranstaltungen/page/informationen#web2pyAndroid 2. additionally cache problems on Android is caused by the disk cache functionality - I haven't looked into this problem in detail, because web2py works also without disk caching and the normal use-case for web2py on Android is for single-users - it does not makes any sense to use it as a server for more than one user ! Greetings, Nik I did not try but I think yes because it does not use any additional libraries. On Jan 14, 6:50 am, Phyo Arkar phyo.arkarl...@gmail.com wrote: I cant wait to run Web2py on my android 8 inches and 10 inches tablets and develop inside there. But i see this tutorial : Cherrypy on Android! Can we hack rocket to run on android and then we should be able to run web2py on there!http://www.defuze.org/archives/228-running-cherrypy-on-android-with-s... Anyone up for that? Thanks Phyo. -- __ Prof. Dr. Nik Klever - Studiendekan - __ Hochschule Augsburg - Fakultät für Informatik http://www.hs-augsburg.de/informatik/ mailto:nik.kle...@hs-augsburg.de __
[web2py] Resources for setting up for development
Hi All, I've been asked to give a short talk on web2py for a local Python user group. One thing that I am a little intimidated by is that some of these guys have been exposed to the tribal nonsense that somehow seems to keep rearing its ugly head, and so I'm concerned to anticipate the sorts of questions that might come up. I'm happy with the PEP8 and import parts of the piece, but I'm a bit concerned about questions about setting up a development environment - my own set-up is very simple (I use SPE as an editor), but my solution to the code-completion issue is distinctly inelegant. Can anyone point me to good resources for setting up various IDEs for web2py, so that I can point people in the right direction? There is quite a bit out there, mostly about Eclipse/Aptana, but most of it is very old so I'm concerned that I'm missing a more elegant way. --- Cheers, PhilK
Re: [web2py] Resources for setting up for development
http://wingware.com/doc/howtos/web2py On Sun, Jan 15, 2012 at 12:39 PM, glimmung phil.kil...@gmail.com wrote: Hi All, I've been asked to give a short talk on web2py for a local Python user group. One thing that I am a little intimidated by is that some of these guys have been exposed to the tribal nonsense that somehow seems to keep rearing its ugly head, and so I'm concerned to anticipate the sorts of questions that might come up. I'm happy with the PEP8 and import parts of the piece, but I'm a bit concerned about questions about setting up a development environment - my own set-up is very simple (I use SPE as an editor), but my solution to the code-completion issue is distinctly inelegant. Can anyone point me to good resources for setting up various IDEs for web2py, so that I can point people in the right direction? There is quite a bit out there, mostly about Eclipse/Aptana, but most of it is very old so I'm concerned that I'm missing a more elegant way. --- Cheers, PhilK
[web2py] Re: Resources for setting up for development
An open source integrated software for development with RAD and support for web2py is being developed by M. Reingart here: http://code.google.com/p/rad2py .He participates in this group, so maybe he can explain in more detail the features of the project. On 15 ene, 08:39, glimmung phil.kil...@gmail.com wrote: Hi All, I've been asked to give a short talk on web2py for a local Python user group. One thing that I am a little intimidated by is that some of these guys have been exposed to the tribal nonsense that somehow seems to keep rearing its ugly head, and so I'm concerned to anticipate the sorts of questions that might come up. I'm happy with the PEP8 and import parts of the piece, but I'm a bit concerned about questions about setting up a development environment - my own set-up is very simple (I use SPE as an editor), but my solution to the code-completion issue is distinctly inelegant. Can anyone point me to good resources for setting up various IDEs for web2py, so that I can point people in the right direction? There is quite a bit out there, mostly about Eclipse/Aptana, but most of it is very old so I'm concerned that I'm missing a more elegant way. --- Cheers, PhilK
Re: [web2py] priority of web2py CMS
Movuca is a social network engine, but it is also a CMS. It is intended to be generic and customizable, you can create themes, contenttypes etc... If someone do not want the social features such as, user profiles, likes, dislikes, follows and boards. With one click in config and some chsnges in the theme it can be disabled and turned to a normal CMS with only blocks, modules, themes, content in various content types, categories etc. I did not work in category system, but I am open for contributions for it. Movuca features (some working, some in roadmap) - multiple content type - WYSIWYG with media gallery - tag and categories - Search - themeable - ajax plugins, blocks and components - various options for comment system (internal, disqus, facebook, intense debate) - facebook and google login - user profiles - user follow/following - user boards - user activities (timeline) - user pictures album - pages and groups - customizable/themeable email system - ads system - RSS for everything - REST API - Android and IOS client - admin panel - more... it is easy to enable/disable some features in movu.ca I am waiting a pull request if someone want to add or change some feature also to improve the category system. http://zerp.ly/rochacbruno Em 15/01/2012 07:45, Gour g...@atmarama.net escreveu: Hello! In the middle of November Massimo wrote: this will be the top priority after web2py 2.0 is released and the book 4th edition. By the end of November. in regard to working on some decent CMS for web2py. Due to some other engagements, I was not following the group closely, but afaict, the book is released, but there is no web2py 2.0. In the meantime there was InstantPress-2.1 release, but based on my experience when reporting some bug, it took quite some time to be fixed (~2 months), so I guess that the only developer (there are no forks @bitbucket) is probably occupied with other engagements and IP is not his main focus and we gave up on it. Now I also see there is new project Movuca - Social CMS, but our needs are more in the category of 'classical' CMS wahtever it means (we've already discussed it a lot here). So, the question remains if the above statement is still relevant and there is a desire to work on one complete web2py-powered CMS-framework or is it that web2py community is simply more interested for other web-related applications? Nothing wrong with that, just to be sure where to put our present focus. (We, anyway, have to fiddle with PHP Concrete5 at the moment.) btw, what's preventing 2.0 release? Sincerely, Gour -- One who restrains the senses of action but whose mind dwells on sense objects certainly deludes himself and is called a pretender. http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
Re: [web2py] Re: Resources for setting up for development
Hi Alan, On Sun 15 Jan 2012 12:37:26 GMT, Alan Etkin wrote: An open source integrated software for development with RAD and support for web2py is being developed by M. Reingart here: http://code.google.com/p/rad2py .He participates in this group, so maybe he can explain in more detail the features of the project. Thanks for that - definitely worth a mention. However, what I'm more focused on is being able to point people using their existing development tools towards some docs that they'll understand. I have a couple of files (one for models, one for controllers), with a great long list of imports and what have you to support the editing process, and I import from those files. It works fine for me, but it's not pretty, and it rather undermines Massimo's statement in the book that web2py is trying to avoid the annoying characteristic of other frameworks that force the developer to import the same modules at the top of every model and controller if I'm doing exactly that to support editing, even if the code is dead in production! In reality, I've been asked to give a short informal talk to a friendly group, but the intemperate nature of some of the negative comments about web2py makes me feel like an ambassador for web2py venturing into potentially hostile territory...
[web2py] The deference between router.example and routes.example ??
Dear All , What is The deference between router.example and routes.example ?? and how can i use this : domains = { domain.com : app, x.domain.com : appx, },
[web2py] Re: [FYI] DAL IMAPAdapter
That will work (at least worked in develepment with Gmail). Beware that a new mail account login and mailbox list query is made on each request to construct a working dal instance. This adds a lot of network traffic and may raise bandwidth and account limit issues when reaching a given usage, mainly because I have not managed to add connection pooling and caching of account parameters to reduce transactions yet. Another issue with the current example is that extense queries might kill the server memory because to inspect the messages contents for managing queries it is needed to fetch the whole RFC822 On 14 ene, 22:35, Bruno Rocha rochacbr...@gmail.com wrote: Actually, I did not add any sending mail feature, since it can be accomplished with tools.Mail. Yes, what I need is a simple API to read emails from google, the workflow should be. User obtain a key from settings page in movu.ca CMS e.g *x4f567899083* Now the user can publish posts to CMS by sending an e-mail to movucacms+* x4f5678990...@gmail.com I will use DAL with your API to rows = imapdb(imapdb.INBOX.to.contains(*x4f567899083*)).select() So I can take the email, parse and process to publish as a post in CMS. I am going to try it! -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: priority of web2py CMS
On Sun, 15 Jan 2012 10:47:31 -0200 Bruno Rocha rochacbr...@gmail.com wrote: Movuca is a social network engine, but it is also a CMS. OK. It is intended to be generic and customizable, you can create themes, contenttypes etc... This sounds good. New contentypes are sort of plugins or something else? If someone do not want the social features such as, user profiles, likes, dislikes, follows and boards. Nice. With one click in config and some chsnges in the theme it can be disabled and turned to a normal CMS with only blocks, modules, themes, content in various content types, categories etc. Hmm...I'll put it on my list for evaluation. Movuca features (some working, some in roadmap) - multiple content type - WYSIWYG with media gallery - tag and categories - Search - themeable - ajax plugins, blocks and components - various options for comment system (internal, disqus, facebook, intense debate) - facebook and google login - user profiles - user follow/following - user boards - user activities (timeline) - user pictures album - pages and groups - customizable/themeable email system - ads system - RSS for everything - REST API - Android and IOS client - admin panel - more... it is easy to enable/disable some features in movu.ca Thanks a lot for your input. Looks as the best web2py-based CMS so far. ;) Sincerely, Gour -- But those who, out of envy, disregard these teachings and do not follow them are to be considered bereft of all knowledge, befooled, and ruined in their endeavors for perfection. http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 signature.asc Description: PGP signature
Re: [web2py] Re: Movuca - The Social CMS - Need Testers and Contributors
Thanks Bruno, I am now experimenting with it. Probably worth mentioning for the benefit of others that changing a line in controllers/setup.py was sufficient to get things initially going: config = Config(autogetconfig=False) to config = Config(autogetconfig=True)
Re: [web2py] Re: priority of web2py CMS
content types are posts but you can customize the fields it has to store in db. and customize the new/edit/show views. you can also include specific methods for each content type you can specify how a content type will be listed and its privacy options. the idea is to have content types created by community, so you can install then http://www.movu.ca/demo/article/show/1/how-to-create-content-types-in-movuca-cms Em 15/01/2012 11:24, Gour g...@atmarama.net escreveu: On Sun, 15 Jan 2012 10:47:31 -0200 Bruno Rocha rochacbr...@gmail.com wrote: Movuca is a social network engine, but it is also a CMS. OK. It is intended to be generic and customizable, you can create themes, contenttypes etc... This sounds good. New contentypes are sort of plugins or something else? If someone do not want the social features such as, user profiles, likes, dislikes, follows and boards. Nice. With one click in config and some chsnges in the theme it can be disabled and turned to a normal CMS with only blocks, modules, themes, content in various content types, categories etc. Hmm...I'll put it on my list for evaluation. Movuca features (some working, some in roadmap) - multiple content type - WYSIWYG with media gallery - tag and categories - Search - themeable - ajax plugins, blocks and components - various options for comment system (internal, disqus, facebook, intense debate) - facebook and google login - user profiles - user follow/following - user boards - user activities (timeline) - user pictures album - pages and groups - customizable/themeable email system - ads system - RSS for everything - REST API - Android and IOS client - admin panel - more... it is easy to enable/disable some features in movu.ca Thanks a lot for your input. Looks as the best web2py-based CMS so far. ;) Sincerely, Gour -- But those who, out of envy, disregard these teachings and do not follow them are to be considered bereft of all knowledge, befooled, and ruined in their endeavors for perfection. http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
Re: [web2py] Re: Movuca - The Social CMS - Need Testers and Contributors
it will get the config values bypassing the cache. config is in a sqlite db, so it is cached for 300s (the expiration is a config option and you can change it) because of that I have the setup/install (which needs a interface) you can reload the cache with setup/reload http://zerp.ly/rochacbruno Em 15/01/2012 12:00, villas villa...@gmail.com escreveu: Thanks Bruno, I am now experimenting with it. Probably worth mentioning for the benefit of others that changing a line in controllers/setup.py was sufficient to get things initially going: config = Config(autogetconfig=False) to config = Config(autogetconfig=True)
[web2py] Screencasts for web2py? where?
Hello, when will we have good quality videos screencasts of web2py? Going from beginner to expert? I ran into a lot of screencasts like peepcode, codeschool. This guys are very good,but for RAILS, not for web2py. When it comes to web2py i only run into Massimo videos.And those are not the school of web2py. Only some nice features This is very litle in my opinion. With thousands of us in this blog it should have produced more quality videos by now like the ones we see in peepcode or codeschool for example Don´t you think? Thank you António
Re: [web2py] Screencasts for web2py? where?
2012/1/15 António Ramos ramstei...@gmail.com Hello, when will we have good quality videos screencasts of web2py? Going from beginner to expert? I ran into a lot of screencasts like peepcode, codeschool. This guys are very good,but for RAILS, not for web2py. When it comes to web2py i only run into Massimo videos.And those are not the school of web2py. Only some nice features This is very litle in my opinion. With thousands of us in this blog it should have produced more quality videos by now like the ones we see in peepcode or codeschool for example Don´t you think? Thank you António Yeah, I do the same thing (http://vimeo.com/user315328) but it would be interesting something like railscasts.com (just as an example) Javier
Re: [web2py] Screencasts for web2py? where?
what about this http://www.youtube.com/playlist?list=PL5E2E223FE3777851 I have 36 videos but it is all in portuguese and part of cursodepython.com.br I am planning to include english subtitles or record new with my bad english pronunciation. BTW it is not all free, I released some free but the most important are closed to students. http://zerp.ly/rochacbruno Em 15/01/2012 12:38, António Ramos ramstei...@gmail.com escreveu: Hello, when will we have good quality videos screencasts of web2py? Going from beginner to expert? I ran into a lot of screencasts like peepcode, codeschool. This guys are very good,but for RAILS, not for web2py. When it comes to web2py i only run into Massimo videos.And those are not the school of web2py. Only some nice features This is very litle in my opinion. With thousands of us in this blog it should have produced more quality videos by now like the ones we see in peepcode or codeschool for example Don´t you think? Thank you António
Re: [web2py] Screencasts for web2py? where?
On Sun, Jan 15, 2012 at 9:55 AM, Bruno Rocha rochacbr...@gmail.com wrote: what about this http://www.youtube.com/playlist?list=PL5E2E223FE3777851 I have 36 videos but it is all in portuguese and part of cursodepython.com.br I am planning to include english subtitles or record new with my bad english pronunciation. BTW it is not all free, I released some free but the most important are closed to students. http://zerp.ly/rochacbruno I was interested in your course :) but there seems not to be en english (I'm from Peru but I think english is more common everywhere). I'll see your videos later, thanks for the link Javier Q
Re: [web2py] Re: Resources for setting up for development
eclipse + pydev + webtools http://pydev.org/ That is all Aptana uses anyway. On Sun, Jan 15, 2012 at 4:59 AM, Philip Kilner phil.kil...@gmail.comwrote: Hi Alan, On Sun 15 Jan 2012 12:37:26 GMT, Alan Etkin wrote: An open source integrated software for development with RAD and support for web2py is being developed by M. Reingart here: http://code.google.com/p/**rad2py http://code.google.com/p/rad2py .He participates in this group, so maybe he can explain in more detail the features of the project. Thanks for that - definitely worth a mention. However, what I'm more focused on is being able to point people using their existing development tools towards some docs that they'll understand. I have a couple of files (one for models, one for controllers), with a great long list of imports and what have you to support the editing process, and I import from those files. It works fine for me, but it's not pretty, and it rather undermines Massimo's statement in the book that web2py is trying to avoid the annoying characteristic of other frameworks that force the developer to import the same modules at the top of every model and controller if I'm doing exactly that to support editing, even if the code is dead in production! In reality, I've been asked to give a short informal talk to a friendly group, but the intemperate nature of some of the negative comments about web2py makes me feel like an ambassador for web2py venturing into potentially hostile territory... -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com
Re: [web2py] Screencasts for web2py? where?
dont confuse http://codeschool.org with http://www.codeschool.com 2012/1/15 Javier Quarite jquari...@gmail.com On Sun, Jan 15, 2012 at 9:55 AM, Bruno Rocha rochacbr...@gmail.comwrote: what about this http://www.youtube.com/playlist?list=PL5E2E223FE3777851 I have 36 videos but it is all in portuguese and part of cursodepython.com.br I am planning to include english subtitles or record new with my bad english pronunciation. BTW it is not all free, I released some free but the most important are closed to students. http://zerp.ly/rochacbruno I was interested in your course :) but there seems not to be en english (I'm from Peru but I think english is more common everywhere). I'll see your videos later, thanks for the link Javier Q
[web2py] Re: New Site for web2py poweredby
Hi Andrew, its not perfect I am sure :-P but in line with the rest of the site ;-) I just noticed that now matter which function you visit, the active menu item always is home. Kind regards, Annet
Re: [web2py] Screencasts for web2py? where?
2012/1/15 António Ramos ramstei...@gmail.com dont confuse http://codeschool.org with http://www.codeschool.com I subscribed to codeschool.org two months ago and its very impressive
Re: [web2py] Screencasts for web2py? where?
On Sun, Jan 15, 2012 at 10:23 AM, Javier Quarite jquari...@gmail.comwrote: 2012/1/15 António Ramos ramstei...@gmail.com dont confuse http://codeschool.org with http://www.codeschool.com I subscribed to codeschool.org two months ago and its very impressive jajaja I made a mistake ... codeshool.com, my bad
Re: [web2py] Screencasts for web2py? where?
why wont Massimo use the Force to include web2py in Codeshool.com :) 2012/1/15 Javier Quarite jquari...@gmail.com On Sun, Jan 15, 2012 at 10:23 AM, Javier Quarite jquari...@gmail.comwrote: 2012/1/15 António Ramos ramstei...@gmail.com dont confuse http://codeschool.org with http://www.codeschool.com I subscribed to codeschool.org two months ago and its very impressive jajaja I made a mistake ... codeshool.com, my bad
Re: [web2py] Screencasts for web2py? where?
2012/1/15 António Ramos ramstei...@gmail.com why wont Massimo use the Force to include web2py in Codeshool.com :) :) +1 I guess because envylabs is related only to ruby on rails, (you should see the ads on youtube: RoR vs PHP, NET, etc etc etc)
[web2py] Re: contains return no rows of field list:string
Thank you Denes. I understood and this works fine at shell. At web-application, I use the below code, form = crud.create(db.entries, next = URL('index')) This gets me a simple text field for the 'list:string' field and whatever I enter gets in as, 'one,two,three' I tried to enter ['one','two','three'] and it gets in as a single string. so I'm still on zero. Can someone tell me how to handle (ie. whatever is entered gets in as individual strings and not as a single string) from the web-app. One option I can think of is to create a pain the form with individual fields and then process the form submission. But I hope I could handle this with crud, since it is so easy. Thank you, Joseph
Re: [web2py] Re: Resources for setting up for development
You can now do: from gluon import * to import the entire API (except for request, response, session, and T, which are on the current object). I think something like this should get you code completion: if 0: from gluon import * from gluon.globals import * request = Request(); response = Response(); session = Session() Perhaps others know a better way. Anthony On Sunday, January 15, 2012 7:59:51 AM UTC-5, glimmung wrote: Hi Alan, On Sun 15 Jan 2012 12:37:26 GMT, Alan Etkin wrote: An open source integrated software for development with RAD and support for web2py is being developed by M. Reingart here: http://code.google.com/p/rad2py .He participates in this group, so maybe he can explain in more detail the features of the project. Thanks for that - definitely worth a mention. However, what I'm more focused on is being able to point people using their existing development tools towards some docs that they'll understand. I have a couple of files (one for models, one for controllers), with a great long list of imports and what have you to support the editing process, and I import from those files. It works fine for me, but it's not pretty, and it rather undermines Massimo's statement in the book that web2py is trying to avoid the annoying characteristic of other frameworks that force the developer to import the same modules at the top of every model and controller if I'm doing exactly that to support editing, even if the code is dead in production! In reality, I've been asked to give a short informal talk to a friendly group, but the intemperate nature of some of the negative comments about web2py makes me feel like an ambassador for web2py venturing into potentially hostile territory...
[web2py] Re: The deference between router.example and routes.example ??
routes.example.py is an example of the pattern-based rewrite system, and router.example.py is an example of the parameter-based system (which specifies routers -- hence the filename). Maybe we should rename these to something like: routes.pattern_example.py routes.parameter_example.py See http://web2py.com/books/default/chapter/29/4#URL-rewrite for details. Anthony On Sunday, January 15, 2012 8:14:55 AM UTC-5, Web2Py Freak wrote: Dear All , What is The deference between router.example and routes.example ?? and how can i use this : domains = { domain.com : app, x.domain.com : appx, },
[web2py] Re: examples app doesn't run on apache
I frequently hear people running into trouble running Apache and/or Python on Windows. I'd strongly suggest developing against the Windows download and then deploying on *nix. I don't know about Apache, but there should be no problem running the source version of web2py on Windows along with a Windows installation of Python (though you should also have pywin32 installed: http://sourceforge.net/projects/pywin32/). Probably best to stick with Rocket for development on Windows. Anthony
Re: [web2py] Re: PCBSD 9 release (freebsd 9) cannot start web2py
Hi, I was able to resolve this, it was an issue with PCBSD(freebsd 9) it self the python 2.7 port was broken, and that caused py-sqlite3 to fail on install. I updated the ports and installed py-sqlite3 everything is working as expected now. On Sat, Jan 14, 2012 at 10:50 PM, Bruno Rocha rochacbr...@gmail.com wrote: Judging from your error message and our exchange in the comments, I think the big problem is you might just be missing sqlite3 support for python. From your error messages I take it you're running FreeBSD, so you should install the databases/py-sqlite3 package from ports. I don't know much about FreeBSD's ports system, but after you install the py-sqlite3 package, your problem should hopefully be cleared up. I'm going to assume, from brief reading, you do something like this, assuming you have the ports tree on your system: cd /usr/ports/databases/py-sqlite3 make make install -- http://stackoverflow.com/questions/7973660/python-sqlite3-error-in-freebsd-9 On Sun, Jan 15, 2012 at 4:40 AM, Bruce Wade bruce.w...@gmail.com wrote: ** Now I am running python 2.7 ** On Sat, Jan 14, 2012 at 10:40 PM, Bruce Wade bruce.w...@gmail.comwrote: Hi, Fresh install of pcbsd 9, just downloaded web2py source version, when running python web2py: please visit: http://127.0.0.1:8000 use kill -SIGTERM 21799 to shutdown the web2py server DEBUG: connect attempt 0, connection error: Traceback (most recent call last): File /usr/home/detectedstealth/Downloads/web2py/gluon/dal.py, line 4736, in __init__ self._adapter = ADAPTERS[self._dbname](*args) File /usr/home/detectedstealth/Downloads/web2py/gluon/dal.py, line 1634, in __init__ raise RuntimeError, Unable to import driver RuntimeError: Unable to import driver DEBUG: connect attempt 1, connection error: Traceback (most recent call last): File /usr/home/detectedstealth/Downloads/web2py/gluon/dal.py, line 4736, in __init__ self._adapter = ADAPTERS[self._dbname](*args) File /usr/home/detectedstealth/Downloads/web2py/gluon/dal.py, line 1634, in __init__ raise RuntimeError, Unable to import driver RuntimeError: Unable to import driver DEBUG: connect attempt 2, connection error: Traceback (most recent call last): File /usr/home/detectedstealth/Downloads/web2py/gluon/dal.py, line 4736, in __init__ self._adapter = ADAPTERS[self._dbname](*args) File /usr/home/detectedstealth/Downloads/web2py/gluon/dal.py, line 1634, in __init__ raise RuntimeError, Unable to import driver RuntimeError: Unable to import driver DEBUG: connect attempt 3, connection error: Traceback (most recent call last): File /usr/home/detectedstealth/Downloads/web2py/gluon/dal.py, line 4736, in __init__ self._adapter = ADAPTERS[self._dbname](*args) File /usr/home/detectedstealth/Downloads/web2py/gluon/dal.py, line 1634, in __init__ raise RuntimeError, Unable to import driver RuntimeError: Unable to import driver DEBUG: connect attempt 4, connection error: Traceback (most recent call last): File /usr/home/detectedstealth/Downloads/web2py/gluon/dal.py, line 4736, in __init__ self._adapter = ADAPTERS[self._dbname](*args) File /usr/home/detectedstealth/Downloads/web2py/gluon/dal.py, line 1634, in __init__ raise RuntimeError, Unable to import driver RuntimeError: Unable to import driver Not I am running python 2.7 and the default database is sqlite. -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com -- Bruno Rocha [http://rochacbruno.com.br] -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com http://www.fitnessfriendsfinder.com
Re: [web2py] Re: The deference between router.example and routes.example ??
On Jan 15, 2012, at 8:52 AM, Anthony wrote: routes.example.py is an example of the pattern-based rewrite system, and router.example.py is an example of the parameter-based system (which specifies routers -- hence the filename). Maybe we should rename these to something like: routes.pattern_example.py routes.parameter_example.py Good idea.
[web2py] Re: contains return no rows of field list:string
in the crud form you by default see a single input box for the list of strings right? type the first string, press enter, and a new input box should appear, type the next string and so on. the default widget for list strings has a bunch of keyboard actions to create the list items, but i found it not completely intuitive (i don't have real constructive suggestions for it so i haven't said much about it yet). cfh
Re: [web2py] Re: Responsivekit for web2py!
Hi Alan! If you want to test it with a pc simply resize the browser window, when the windows is of a certain size, it triggers the responsive reflow of tables. Images works same way, but you have to refresh the page to get the resized image, I'll add this instructions to page! Angelo 2012/1/15 Alan Etkin spame...@gmail.com Would it be possible to test it with a desktop pc? I visited the demo and found difficult to appreciate the features. Is image and table resizing being performed by the plugin? On 13 ene, 10:51, Angelo Compagnucci angelo.compagnu...@gmail.com wrote: Hello list, I want to share with you my new plugin (aiming to web2py inclusion!), responsivekit, you can find it on githubhttps:// github.com/angeloc/web2py-responsivekit. Responsivekit implements responsive tables and responsive images using the best known techniques at the moment (I'm basing on Marcotte, SmashingMagazine and filamentgroups reccomendations). More will come! Comments are welcome. Cheers, Angelo -- Profile:http://it.linkedin.com/in/compagnucciangelo -- Profile: http://it.linkedin.com/in/compagnucciangelo
Re: [web2py] Re: New Site for web2py poweredby
Oh ya ty will fix that and will make the template easier to maintain today using {{include nav.html}} etc *cheers On Sun, Jan 15, 2012 at 7:20 AM, Annet anneve...@googlemail.com wrote: Hi Andrew, its not perfect I am sure :-P but in line with the rest of the site ;-) I just noticed that now matter which function you visit, the active menu item always is home. Kind regards, Annet
[web2py] Re: The deference between router.example and routes.example ??
i am using routes.py to clean my urls now i want to route every domain to its website , how can i do that exactly ?
[web2py] Re: The deference between router.example and routes.example ??
According to the book, in routes.py, you can include: routers = dict( BASE = dict( domains = { 'domain1.com' : 'app1', 'domain2.com' : 'app2', } ), ) Note, if you are using the parameter-based system (as above), you cannot also use the pattern-based system. Anthony On Sunday, January 15, 2012 1:34:00 PM UTC-5, Web2Py Freak wrote: i am using routes.py to clean my urls now i want to route every domain to its website , how can i do that exactly ?
[web2py] Re: The deference between router.example and routes.example ??
are you saying that i cant use routes_in , routes_out with domains ??
Re: [web2py] Re: priority of web2py CMS
I think Movuca can be the revolution. It may be all in one, Twitter, Facebook, Wordpress, gTalk, Blave. If each one has an idea of how to integrate all in one would cut as many web pages open, it needs to performance tests to see if all the media protocols are supported at the same time. 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 2012/1/15 Bruno Rocha rochacbr...@gmail.com content types are posts but you can customize the fields it has to store in db. and customize the new/edit/show views. you can also include specific methods for each content type you can specify how a content type will be listed and its privacy options. the idea is to have content types created by community, so you can install then http://www.movu.ca/demo/article/show/1/how-to-create-content-types-in-movuca-cms Em 15/01/2012 11:24, Gour g...@atmarama.net escreveu: On Sun, 15 Jan 2012 10:47:31 -0200 Bruno Rocha rochacbr...@gmail.com wrote: Movuca is a social network engine, but it is also a CMS. OK. It is intended to be generic and customizable, you can create themes, contenttypes etc... This sounds good. New contentypes are sort of plugins or something else? If someone do not want the social features such as, user profiles, likes, dislikes, follows and boards. Nice. With one click in config and some chsnges in the theme it can be disabled and turned to a normal CMS with only blocks, modules, themes, content in various content types, categories etc. Hmm...I'll put it on my list for evaluation. Movuca features (some working, some in roadmap) - multiple content type - WYSIWYG with media gallery - tag and categories - Search - themeable - ajax plugins, blocks and components - various options for comment system (internal, disqus, facebook, intense debate) - facebook and google login - user profiles - user follow/following - user boards - user activities (timeline) - user pictures album - pages and groups - customizable/themeable email system - ads system - RSS for everything - REST API - Android and IOS client - admin panel - more... it is easy to enable/disable some features in movu.ca Thanks a lot for your input. Looks as the best web2py-based CMS so far. ;) Sincerely, Gour -- But those who, out of envy, disregard these teachings and do not follow them are to be considered bereft of all knowledge, befooled, and ruined in their endeavors for perfection. http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
Re: [web2py] Re: The deference between router.example and routes.example ??
On Jan 15, 2012, at 11:46 AM, Web2Py Freak wrote: are you saying that i cant use routes_in , routes_out with domains ?? Only if you do your own domain mapping in routes_in routes_out.
[web2py] Inherit type from parent
Hi all, once again I turn to you with my latest question. I have a self-referencing table: db.define_table('accounts', Field('name','string'), Field('parent_account','reference accounts'), Field('account_type','string')) What I'm trying to achieve is to create a tree-like structure. So we have 5 root accounts, which can each hold some sub-accounts etc. Now the account_type must be the same for all the children of a certain account. So the root accounts pre-determine all of the children's account type, rendering it unwritable for a child account. For some reason the following didn't work for me: account_types = ['a','b','c'] db.accounts.account_type.requires = IS_IN_SET(account_types) db.accounts.account_type.required = True db.accounts.account_type.compute = lambda x: x['parent_account'].account_type db.accounts.account_type.writeable = lambda x: (x['parent_account'] == 0) Thanks for your help, Tsvi
[web2py] Re: The deference between router.example and routes.example ??
i dont understand ,can explain some more please ?
[web2py] Represent - redirect
Hello, I have a select crud, with a URL in the column id. If I click 'edit', I should be redirected to a page, where I can update the concerned contact_part record. (as in a grid) What should I put between the URL brackets ? _href=URL() How do I pass the selected record ? My code : table=db.contact_part db.contact_part.id.represent = lambda id, row: A('edit',_href=URL()) query = (db.contact_part.contact==session.contactID) form3 = crud.select(table,query,fields=['contact_part.subject','contact_part.tags','contact_part.id']) Thanks Mathias
[web2py] Re: migration not working
No. That suggests you should migrate one field at the time to play it safe. When you are confortable with migrations then you can make more complex migrations. On Jan 15, 1:19 am, Likit lewis_le...@hotmail.com wrote: ...which I did... Ummm... that sort of suggests I might as well ALWAYS set migrate=False in my DAL connector for MySQL? I don't mind--it's not too hard to make the changes and it helps focus on db design. Sounds like Postgres is a better longterm choice. On Jan 14, 10:39 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Mysql does not support multiple alter table in one transaction that is why it is possible for mysql to get into this state. notice this cannot happen with postgresql which perform the entire migration in one transaction. You need to manually ALTER TABLE and DELETE joke_id__tmp On Jan 14, 10:02 pm, Likit lewis_le...@hotmail.com wrote: I am trying to use the many-2-many DAL syntax suggested by the manual and the examples. In this approach, a field name is associated with a TABLE name. I have not been able to get this to work with MySQL. So, I have used the more conventional approach of using an integer field to hold the key value from the relationship table. Instead of dogs and persons I have jokes and categories, but it's the same thing. The goal is to be able to express relations for jokes with no category, jokes with one or more categories, categories with one or more jokes, and categories with no jokes. The ideal query returns all of these, if they exist. Here is the model for my conventional approach: jodb.define_table('joke', Field('joketext', 'text',length=2048), Field('created_on', 'datetime', default=request.now), Field('created_by', jodb.auth_user, default=auth.user_id)) jodb.define_table('category', Field('name', 'text')) jodb.define_table('joke_category', Field('joke_id', 'integer'), Field('category_id', 'integer')) jodb.category.name.requires = IS_NOT_EMPTY() jodb.joke.joketext.requires = IS_NOT_EMPTY() All was good except I couldn't get the query to work using the persons/ dogs many-to-many approach. I was not getting jokes with no categories and categories with no jokes. So, I decided to follow the manual more closely to see if I could try the queries from the example. Thus, I tried to change the field definitions in the relations table to associate the id field with a TABLE as in: jodb.define_table('joke_category', Field('joke_id', jodb.joke), Field('category_id', 'integer')) Yes, I would need to do the same for category, but I wanted to do one at a time because I had read somewhere that MySQL migrations did not work with multiple pending changes (don't know if that is really true...). Anyway, seemed easier to do one at a time. So, I made the immediately preceding change in the model. In attempting to do the migration, MySQL got an error 150. When this happens, either web2py or MySQL will hang. So, I stopped everything. Upon resuming everything, I tried to go back to the original way I had it (above). This appears to cause a second migration with the following result: 127.0.0.1.2012-01-14.19-48-00.189cb495-7851-429d-a0cb-bd23156431f1 class 'gluon.contrib.pymysql.err.InternalError' (1060, uDuplicate column name 'joke_id__tmp') VERSION web2py™ (1, 99, 4, datetime.datetime(2011, 12, 14, 14, 46, 14), 'stable') Python TRACEBACK Traceback (most recent call last): File c:\web2py\gluon\restricted.py, line 204, in restricted exec ccode in environment File c:/web2py/applications/pyjokes/models/db.py, line 55, in module Field('category_id', 'integer')) File c:\web2py\gluon\dal.py, line 5097, in define_table polymodel=polymodel) File c:\web2py\gluon\dal.py, line 728, in create_table fake_migrate=fake_migrate) File c:\web2py\gluon\dal.py, line 816, in migrate_table self.execute(sub_query) File c:\web2py\gluon\dal.py, line 1359, in execute return self.log_execute(*a, **b) File c:\web2py\gluon\dal.py, line 1353, in log_execute ret = self.cursor.execute(*a, **b) File c:\web2py\gluon\contrib\pymysql\cursors.py, line 108, in execute self.errorhandler(self, exc, value) File c:\web2py\gluon\contrib\pymysql\connections.py, line 184, in defaulterrorhandler raise errorclass, errorvalue InternalError: (1060, uDuplicate column name 'joke_id__tmp') Note the duplicate column name. It seems that the first migration created a tmp field to move the column values over to the newly created column. This hung, but the tmp column must have been created. The second migration--to get back (which I erroneously thought wouldn't happen at all, assuming the first migration had failed completely--clearly
[web2py] Re: what triggers a db migration
+1 On Jan 15, 1:21 am, pbreit pbreitenb...@gmail.com wrote: Migrations are pretty powerful but problems can arise. As I've suggested elsewhere, best to develop against SQLite and then deploy as desired. In development, I change models frequently. If I run into a problem that I can't fix with migrations, I might delete the whole database folder and start over. That's simple with SQLite. The sql.log is just a log. I think web2py compares the .table files to the database to figure out what needs to be migrated. I think fake_migrate rebuilds the .table files according to the model files without touching the DB. There's probably room for improvement in the documentation, especially around fixing broken migrations, what the files are in the database folder and what migrate/fake_migrate actually do.
[web2py] Re: Cherrypy can run on android ! without any patching needed , Can Rocket do that?
Nice. perhaps we could by-pass shelve and provide out own implementation based on sqlite. Actually I have this coded already... pros, cons? On Jan 15, 4:28 am, Nik Klever nik.kle...@hs-augsburg.de wrote: web2py runs on Android - I've tested it with my Motorola Defy. The only problems, I discovered until now concerns the cache: 1. gluon/cache.py uses the python standard library shelve. And shelve on Android uses dumbdbm instead of anydbm as normally on unix systems, this leads to problems in creating new database files for caching - in web2py therefor in creating applications. I solved this with a short workaround of cache.py (see attachment) and a default cache-archive (see attachment). This is still a workaround, because this problem should be solved by shelve in the standard library and not by web2py ! The attachments can be found on my server:http://klever.hs-augsburg.de/Veranstaltungen/page/informationen#web2p... 2. additionally cache problems on Android is caused by the disk cache functionality - I haven't looked into this problem in detail, because web2py works also without disk caching and the normal use-case for web2py on Android is for single-users - it does not makes any sense to use it as a server for more than one user ! Greetings, Nik I did not try but I think yes because it does not use any additional libraries. On Jan 14, 6:50 am, Phyo Arkar phyo.arkarl...@gmail.com wrote: I cant wait to run Web2py on my android 8 inches and 10 inches tablets and develop inside there. But i see this tutorial : Cherrypy on Android! Can we hack rocket to run on android and then we should be able to run web2py on there!http://www.defuze.org/archives/228-running-cherrypy-on-android-with-s... Anyone up for that? Thanks Phyo. -- __ Prof. Dr. Nik Klever - Studiendekan - __ Hochschule Augsburg - Fakultät für Informatikhttp://www.hs-augsburg.de/informatik/ mailto:nik.kle...@hs-augsburg.de __
[web2py] Executing controller- and function-specific models in web2py shell
If running a web2py shell, how can model files within controller subdirectories be made available in the environment? For example if we have these two model files: myapp/models/db.py myapp/models/acontroller/db_controller.py Then when launching web2py using: $ python web2py.py -S myapp -M Typing 'db.tables' prints tables defined in db.py Is there a way to specify a controller (or function) to execute models for in a web2py shell? Thanks
Re: [web2py] Executing controller- and function-specific models in web2py shell
I guess you can do inside the web2py shell environment. execfile(applications/myapp/models/acontroller/somefile.py) Not tested, but should work. if you are using Ipython, doing edit path/to/file and then exit saving the file the file is also executed On Sun, Jan 15, 2012 at 7:55 PM, Robert Clark robert.cl...@niftybean.comwrote: If running a web2py shell, how can model files within controller subdirectories be made available in the environment? For example if we have these two model files: myapp/models/db.py myapp/models/acontroller/db_controller.py Then when launching web2py using: $ python web2py.py -S myapp -M Typing 'db.tables' prints tables defined in db.py Is there a way to specify a controller (or function) to execute models for in a web2py shell? Thanks -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: Executing controller- and function-specific models in web2py shell
If you do execfile('applications/app/controllers/default.py') you will expose them all. The problem is that they may have logic like @auth.requires_login() decorators which may prevent you from calling those functions. If you want to do this better you should define make the controllers delegate execution for funcitons in a module and import the module. Massimo On Jan 15, 3:55 pm, Robert Clark robert.cl...@niftybean.com wrote: If running a web2py shell, how can model files within controller subdirectories be made available in the environment? For example if we have these two model files: myapp/models/db.py myapp/models/acontroller/db_controller.py Then when launching web2py using: $ python web2py.py -S myapp -M Typing 'db.tables' prints tables defined in db.py Is there a way to specify a controller (or function) to execute models for in a web2py shell? Thanks
Re: [web2py] Re: Executing controller- and function-specific models in web2py shell
I guess he wants to exec a submodel, not a controller! On Sun, Jan 15, 2012 at 8:54 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: If you do execfile('applications/app/controllers/default.py') you will expose them all. The problem is that they may have logic like @auth.requires_login() decorators which may prevent you from calling those functions. If you want to do this better you should define make the controllers delegate execution for funcitons in a module and import the module. Massimo On Jan 15, 3:55 pm, Robert Clark robert.cl...@niftybean.com wrote: If running a web2py shell, how can model files within controller subdirectories be made available in the environment? For example if we have these two model files: myapp/models/db.py myapp/models/acontroller/db_controller.py Then when launching web2py using: $ python web2py.py -S myapp -M Typing 'db.tables' prints tables defined in db.py Is there a way to specify a controller (or function) to execute models for in a web2py shell? Thanks -- Bruno Rocha [http://rochacbruno.com.br]
[web2py] Re: Responsivekit for web2py!
Thank you. I continued using the demo and could see the resizing effect. Really impressing. It would be interesting to have a way to activate/deactivate this feature transparently by default in the scaffolding application with a simple function call or a Settings attribute. On 15 ene, 14:32, Angelo Compagnucci angelo.compagnu...@gmail.com wrote: Hi Alan! If you want to test it with a pc simply resize the browser window, when the windows is of a certain size, it triggers the responsive reflow of tables. Images works same way, but you have to refresh the page to get the resized image, I'll add this instructions to page! Angelo 2012/1/15 Alan Etkin spame...@gmail.com Would it be possible to test it with a desktop pc? I visited the demo and found difficult to appreciate the features. Is image and table resizing being performed by the plugin? On 13 ene, 10:51, Angelo Compagnucci angelo.compagnu...@gmail.com wrote: Hello list, I want to share with you my new plugin (aiming to web2py inclusion!), responsivekit, you can find it on githubhttps:// github.com/angeloc/web2py-responsivekit. Responsivekit implements responsive tables and responsive images using the best known techniques at the moment (I'm basing on Marcotte, SmashingMagazine and filamentgroups reccomendations). More will come! Comments are welcome. Cheers, Angelo -- Profile:http://it.linkedin.com/in/compagnucciangelo -- Profile:http://it.linkedin.com/in/compagnucciangelo
[web2py] Re: what triggers a db migration
Thanks, all. This is closed. I am progressing to more deployment complexity: locally develop on xampp with apache and mysql; occasionally run rocket/sqlite if I can't figure things out move things to SuSE server in my office and access behind firewall on own network move things to Linode (probably Centos) after they really, really work! Slowly but surely I am getting to understand this. Deployment still seems the biggest bug-a-boo. On Jan 15, 12:51 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: +1 On Jan 15, 1:21 am, pbreit pbreitenb...@gmail.com wrote: Migrations are pretty powerful but problems can arise. As I've suggested elsewhere, best to develop against SQLite and then deploy as desired. In development, I change models frequently. If I run into a problem that I can't fix with migrations, I might delete the whole database folder and start over. That's simple with SQLite. The sql.log is just a log. I think web2py compares the .table files to the database to figure out what needs to be migrated. I think fake_migrate rebuilds the .table files according to the model files without touching the DB. There's probably room for improvement in the documentation, especially around fixing broken migrations, what the files are in the database folder and what migrate/fake_migrate actually do.
[web2py] Re: examples app doesn't run on apache
I am starting simple: - develop locally on xampp/mysql; try things out on rocket/sqlite if I can't figure something out - move to SuSELinux server in my office and access across lan - move to linode probably on centos for the real world after things really, really work I commented out caching decoration in the controller for examples and that did not fix things. I will look into Massimo's suggestion although it's only somewhat applicable as I'll be comparing an apache config on linux to one on windows--but there might be some hints there. On Jan 15, 8:57 am, Anthony abasta...@gmail.com wrote: I frequently hear people running into trouble running Apache and/or Python on Windows. I'd strongly suggest developing against the Windows download and then deploying on *nix. I don't know about Apache, but there should be no problem running the source version of web2py on Windows along with a Windows installation of Python (though you should also have pywin32 installed:http://sourceforge.net/projects/pywin32/). Probably best to stick with Rocket for development on Windows. Anthony
[web2py] Re: Application-wide exception handler?
I put this in my model file and it did exactly what I wanted. Thanks! Is there a reason my attempts to use sys.excepthook failed? This was my test code, which triggered the normal web2py exception handling, which pointed to the raise line: -- import sys def handler(t, v, tb): redirect(http://example.com;) sys.excepthook = handler raise Exception(should trigger a redirect) --- On Jan 14, 12:28 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: you can do, in controller def mycaller(f): try: return f() except IOError: redirect(URL('my_IOError_page')) response._caller = mycaller response._caller wraps all action calls. Give it a try and let us know if this works. On Jan 13, 8:23 pm, spiffytech spiffyt...@gmail.com wrote: My web2py application is littered with calls to a library that loves throwing exceptions when the website it connects to isn't available. I'd like my web2py app to catch the exceptions thrown by the library and redirect the user to a friendly error page. However, there are too many library calls to load up the app with try/except statements all over the place. Is there something I can put in my models file that will catch all exceptions of a certain type and handle them?
[web2py] Re: examples app doesn't run on apache
Does your Apache httpd log show any further details? Are you using routes.py file? What in your /web2py directory is currently different from a clean install? Is it still the case the your apps are working fine and it is only the examples app that is erroring? COuld you try making a copy of examples and renaming it?
[web2py] Re: what triggers a db migration
Have you considered developing against rocket/sqlite? CentOS should be fine. I've seen a lot of people happy with Ubuntu (10.04 or the latest). I've found Ubuntu to be easy to work with with lots of help available.
[web2py] Re: Resources for setting up for development
My sense is that few Python programmers use IDEs (I don't know any that do). If it's a brief talk, I'd suggest just using the file system and a good text editor and moving quickly to some of the great features of Web2py. If someone complains about code completion, you can say it's possible (with Anthony's suggestion) and move on.
[web2py] error class proposal
I was thinking about the form validation. I thought that it may be useful to include an error class on the input widget when the form is submitted and has invalid data. ie. from divclass=w2p_fw inputid=auth_user_passwordclass=passwordtype=passwordvalue=name=password divid=password__errorclass=errorstyle=display: block;too short/div /div to divclass=w2p_fw inputid=auth_user_passwordclass=password errortype=passwordvalue=name=password divid=password__errorclass=errorstyle=display: block;too short/div /div Notice the error is the class of the input. I think this would be very useful and don't think it would break any backwards compatibility. Thanks.
[web2py] ValueError: invalid literal for int() with base 10
Hello I just updated web2py and after restarting uwsgi I get an error on my site ValueError: invalid literal for int() with base 10: '05 04:36:30' Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. Traceback (most recent call last): File /opt/web2py/gluon/restricted.py, line 204, in restricted exec ccode in environment File /opt/web2py/applications/pstv/controllers/default.py https://85.25.149.220/admin/edit/pstv/controllers/default.py, line 105, in module File /opt/web2py/gluon/globals.py, line 172, in lambda self._caller = lambda f: f() File /opt/web2py/applications/pstv/controllers/default.py https://85.25.149.220/admin/edit/pstv/controllers/default.py, line 23, in index trailers = db(db.trailer.id0).select(orderby=~db.trailer.air_date) File /opt/web2py/gluon/dal.py, line 6333, in select return self.db._adapter.select(self.query,fields,attributes) File /opt/web2py/gluon/dal.py, line 1282, in select rows = response(sql) File /opt/web2py/gluon/dal.py, line 1272, in response self.execute(sql) File /opt/web2py/gluon/dal.py, line 1359, in execute return self.log_execute(*a, **b) File /opt/web2py/gluon/dal.py, line 1353, in log_execute ret = self.cursor.execute(*a, **b) File /usr/lib/python2.6/sqlite3/dbapi2.py, line 63, in convert_date return datetime.date(*map(int, val.split(-))) ValueError: invalid literal for int() with base 10: '05 04:36:30' Any ideas?
[web2py] Re: ValueError: invalid literal for int() with base 10
This is my code for that page def index(): schedule = db(db.schedule.date==request.now.strftime(%Y-%m-%d)).select(orderby=~db.schedule.date) episodes = db(db.episodes.id0).select(orderby=~db.episodes.created_on) categories = db(db.episode_categories.id0).select() trailers = db(db.trailer.id0).select(orderby=~db.trailer.air_date) return dict(schedule=schedule,episodes=episodes,categories=categories,trailers=trailers) *cheers ty :D On Sun, Jan 15, 2012 at 6:02 PM, Andrew Evans cheer10s.rusty...@gmail.comwrote: Hello I just updated web2py and after restarting uwsgi I get an error on my site ValueError: invalid literal for int() with base 10: '05 04:36:30' Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. Traceback (most recent call last): File /opt/web2py/gluon/restricted.py, line 204, in restricted exec ccode in environment File /opt/web2py/applications/pstv/controllers/default.py https://85.25.149.220/admin/edit/pstv/controllers/default.py, line 105, in module File /opt/web2py/gluon/globals.py, line 172, in lambda self._caller = lambda f: f() File /opt/web2py/applications/pstv/controllers/default.py https://85.25.149.220/admin/edit/pstv/controllers/default.py, line 23, in index trailers = db(db.trailer.id0).select(orderby=~db.trailer.air_date) File /opt/web2py/gluon/dal.py, line 6333, in select return self.db._adapter.select(self.query,fields,attributes) File /opt/web2py/gluon/dal.py, line 1282, in select rows = response(sql) File /opt/web2py/gluon/dal.py, line 1272, in response self.execute(sql) File /opt/web2py/gluon/dal.py, line 1359, in execute return self.log_execute(*a, **b) File /opt/web2py/gluon/dal.py, line 1353, in log_execute ret = self.cursor.execute(*a, **b) File /usr/lib/python2.6/sqlite3/dbapi2.py, line 63, in convert_date return datetime.date(*map(int, val.split(-))) ValueError: invalid literal for int() with base 10: '05 04:36:30' Any ideas?
[web2py] Re: contains return no rows of field list:string
Thank you. It works. Just for completeness: I had designed a layout from scratch and hence had left out web2py_ajax.html. For this widget to work, it is essential that this file is included. Regards, Joseph
[web2py] Re: Output from some controller
Thanks Massimo, you were great's people.. 1. if we read from file resulted from redirected stdout, i think that we get complete output finally, not ongoing process output ?? that was right, Massimo ?? correct me if i'm wrong .. 2. if we are using popen (popen2 or whatever), first arguments was cmd.. i think that cmd was external program or script, not function inside controller.. is true like that ? i don't want use external script/helper.. is it possible ? On Jan 15, 12:15 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I think apt sends the output to stdout. There are two ways to capture that: 1) redirect stdout to a file, then read and display the file. This is not thread safe which requires you lock when you do it 2) use multiprocessing or popen and run the function in a separate process which then captures the output. I this case I would go with 1. On Jan 12, 8:24 pm, blackshirt fatkhulmusli...@gmail.com wrote: i have some a littel coding with web2py framework.. here is my controller and file : def update(): cache = apt.Cache() progress = apt.progress.TextFetchProgress() res = cache.update(progress) return dict(res = res) in this related view.. {{extend 'layout.html'}} {{=res}} {{pass}} the controller works normally, ie. update the APT database.. i see it progress on console output. but on view just return value True after process update finish... i hope, the output progress, like this normally : Hithttp://ftp.hk.debian.orgstableRelease.gpg Hithttp://security.debian.orgstable/updatesRelease.gpg Ignoredhttp://security.debian.org/stable/updates/contribTranslation- en Failedhttp://security.debian.org/stable/updates/contribTranslation- en Ignoredhttp://security.debian.org/stable/updates/mainTranslation-en Failedhttp://security.debian.org/stable/updates/mainTranslation-en Ignoredhttp://security.debian.org/stable/updates/non-free Translation-en Failedhttp://security.debian.org/stable/updates/non-freeTranslation- en Hithttp://security.debian.orgstable/updatesRelease Donehttp://security.debian.orgstable/updatesRelease Ignoredhttp://ftp.hk.debian.org/debian/stable/contribTranslation-en Failedhttp://ftp.hk.debian.org/debian/stable/contribTranslation-en Hithttp://security.debian.orgstable/updates/mainamd64 Packages Ignoredhttp://ftp.hk.debian.org/debian/stable/mainTranslation-en Failedhttp://ftp.hk.debian.org/debian/stable/mainTranslation-en Hithttp://security.debian.orgstable/updates/contribamd64 Packages Hithttp://security.debian.orgstable/updates/non-freeamd64 Packages Ignoredhttp://ftp.hk.debian.org/debian/stable/non-freeTranslation- en Failedhttp://ftp.hk.debian.org/debian/stable/non-freeTranslation-en Hithttp://ftp.hk.debian.orgstableRelease Donehttp://ftp.hk.debian.orgstableRelease Hithttp://ftp.hk.debian.orgstable/mainSources Hithttp://ftp.hk.debian.orgstable/contribSources Hithttp://ftp.hk.debian.orgstable/non-freeSources Hithttp://ftp.hk.debian.orgstable/mainamd64 Packages Hithttp://ftp.hk.debian.orgstable/contribamd64 Packages Hithttp://ftp.hk.debian.orgstable/non-freeamd64 Packages Done downloading showing on the view output.. How we can do this on web2py ? i'm still pretty newbie on python and web2py thanks
[web2py] Re: Application-wide exception handler?
Is there a reason my attempts to use sys.excepthook failed? This was my test code, which triggered the normal web2py exception handling, which pointed to the raise line: -- import sys def handler(t, v, tb): redirect(http://example.com;) sys.excepthook = handler raise Exception(should trigger a redirect) Perhaps because requests are executed in threads (I believe sys.excepthook doesn't work in threads). Anthony
[web2py] Re: Executing controller- and function-specific models in web2py shell
When running the shell, the app can actually be in a/c/f format, so try: $ python web2py.py -S myapp/acontroller -M That will execute the acontroller.py controller when starting up the shell, so it will also execute any acontroller specific models as well. If you specify myapp/acontroller/afunction, that will execute the afunction() function within acontroller.py, so that should execute any afunction() specific models (I think). Anthony On Sunday, January 15, 2012 4:55:43 PM UTC-5, Robert Clark wrote: If running a web2py shell, how can model files within controller subdirectories be made available in the environment? For example if we have these two model files: myapp/models/db.py myapp/models/acontroller/db_controller.py Then when launching web2py using: $ python web2py.py -S myapp -M Typing 'db.tables' prints tables defined in db.py Is there a way to specify a controller (or function) to execute models for in a web2py shell? Thanks
[web2py] Re: The deference between router.example and routes.example ??
On Sunday, January 15, 2012 3:36:59 PM UTC-5, Web2Py Freak wrote: i dont understand ,can explain some more please ? In routes.py, router = dict(...) and routes_in = (...) routes_out = (...) are mutually exclusive -- if you want to use a router, you cannot also use routes_in/routes_out, and vice versa. Hence the two separate example files. So, if you want to use routes_in/routes_out, then you would have to handle the domain mapping via patterns specified in routes_in/routes_out, not via the simpler router method. Read the end of this section (http://web2py.com/books/default/chapter/29/4#Pattern-based-system) for details on matching domains in routes_in/routes_out. Anthony
[web2py] Re: Inherit type from parent
db.define_table('accounts', Field('name','string'), Field('parent_account','reference accounts'), Field('account_type','string')) What I'm trying to achieve is to create a tree-like structure. So we have 5 root accounts, which can each hold some sub-accounts etc. Now the account_type must be the same for all the children of a certain account. So the root accounts pre-determine all of the children's account type, rendering it unwritable for a child account. For some reason the following didn't work for me: account_types = ['a','b','c'] db.accounts.account_type.requires = IS_IN_SET(account_types) db.accounts.account_type.required = True db.accounts.account_type.compute = lambda x: x['parent_account'].account_type db.accounts.account_type.writeable = lambda x: (x['parent_account'] == 0) For the compute attribute, maybe: db.accounts.account_type.compute = lambda r: db.accounts[r.parent_account].account_type if r.parent_account else None However, I don't think you can set the writeable attribute this way because you won't know if a parent account is going to be specified until after the new record is submitted, which happens after you have to decide whether to make the account_type field writeable. Instead you might need some client side JS and Ajax to dynamically set the account_type if the user selects a parent_account in the form. Anthony
[web2py] How is the best way to export/import auth_user database?
I need to migrate to new server. How is the best way to export auth_user data from the old and import to the new database and all username/passwords to be used with no change?
[web2py] Re: How is the best way to export/import auth_user database?
Have you looked at http://web2py.com/books/default/chapter/29/6#Exporting-and-importing-data? On Monday, January 16, 2012 2:00:51 AM UTC-5, thstart wrote: I need to migrate to new server. How is the best way to export auth_user data from the old and import to the new database and all username/passwords to be used with no change?
Re: [web2py] Re: Responsivekit for web2py!
Hi Alan, If you use the plugin_responsivekit, simply remove conditional import (or comment it) in plugin_responsivekit/layout.html : !--[if !IE]!-- script language=JavaScript var width_filter = '{{=current.plugins.responsivekit.screensize_filter}}' var controller = '{{=URL(a=request.application, c=current.plugins.responsivekit.screensize_controller , f=current.plugins.responsivekit.screensize_function)}}' /script link rel=stylesheet type=text/css href={{=URL('static','plugin_responsivekit/responsivekit.css')}} / script src={{=URL('static','plugin_responsivekit/responsivekit.js')}}/script !--![endif]-- Removing these lines, you disable loading of responsivekit components. I'll try to add a globlal variable to enable/disable this! I've updated the demo, showing more examples! Thank you for your feedback! 2012/1/16 Alan Etkin spame...@gmail.com Thank you. I continued using the demo and could see the resizing effect. Really impressing. It would be interesting to have a way to activate/deactivate this feature transparently by default in the scaffolding application with a simple function call or a Settings attribute. On 15 ene, 14:32, Angelo Compagnucci angelo.compagnu...@gmail.com wrote: Hi Alan! If you want to test it with a pc simply resize the browser window, when the windows is of a certain size, it triggers the responsive reflow of tables. Images works same way, but you have to refresh the page to get the resized image, I'll add this instructions to page! Angelo 2012/1/15 Alan Etkin spame...@gmail.com Would it be possible to test it with a desktop pc? I visited the demo and found difficult to appreciate the features. Is image and table resizing being performed by the plugin? On 13 ene, 10:51, Angelo Compagnucci angelo.compagnu...@gmail.com wrote: Hello list, I want to share with you my new plugin (aiming to web2py inclusion!), responsivekit, you can find it on githubhttps:// github.com/angeloc/web2py-responsivekit. Responsivekit implements responsive tables and responsive images using the best known techniques at the moment (I'm basing on Marcotte, SmashingMagazine and filamentgroups reccomendations). More will come! Comments are welcome. Cheers, Angelo -- Profile:http://it.linkedin.com/in/compagnucciangelo -- Profile:http://it.linkedin.com/in/compagnucciangelo -- Profile: http://it.linkedin.com/in/compagnucciangelo