[web2py:18767] Re: Would this patch be useful?
I find this object (response.scripts) very useful, especially if it's able to manipulate different HTML elements, not only after page load (__call__ modification?): response.scripts($('#post'), onclick, $('#post .comments').css ({'value', 'sm.th.'})) Probably this breaks the MVC views' rules, but in when it comes to Ajax I feel more comfortable when the presentation logic is in the controller. On Mar 30, 8:18 am, TheDude officed...@gmail.com wrote: This certainly breaks the MVC architecture, but it is valuable. I think web2py should be about being able to expand as much as possible without interfering the people who just want a small and easy framework (it can be a small plant or a big tree). I do like the idea of everything going into the same $().ready() function. After a bit of thinking about it, this would be no different (in terms of usability and mvc structure) as saying something like response.title = 'xxx' within the controller. I'm going to give this a thumbs up, as long as it doesn't slow down the framework and I wont be required to do it. ;) On Mar 30, 12:15 am, mdipierro mdipie...@cs.depaul.edu wrote: Some clarifications. Right now one can already do this in views by inserting somewhere: script $(document).ready(function() { do_something(); }); /script Mr. Freeze's suggestions has pros and cons. In my opinion: Pros: - it is more compact Cons: - moves into the controller something that (usually) belongs to the view. - if the script in quotes has a bug it may break web2py_ajax because everything would go in the same $(..).ready(function(){}). I would like to hear more opinions about this. Perhaps some examples when this would be better than placing the code in the view. Massimo On Mar 29, 10:46 pm, Jason Brower encomp...@gmail.com wrote: Good question. I like the idea as it gives us a nice place to put scripts and make them apply to the views we want very easily. so +1 on that! Regards, Jason Brower On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote: It's basically a new global list, response.scripts, that is rendered in the jQuery(document).ready function so you can inject javascript from the controller. Massimo mentioned that it may go against MVC separation standards and wanted me to put it out here to get a few opinions. Sample usage: def index(): if not request.vars.name: response.scripts.append($('#messages').text('Messages: Name Missing').css('color','red');) else: response.scripts.append($('#messages').text('Messages: Hello + request.vars.name + ');) return dict() What do you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18770] Re: pycon 2009
On Mon, Mar 30, 2009 at 1:28 AM, TheDude officed...@gmail.com wrote: Excellent! I wish there was a video, but I'm sure someone has it somewhere on the internet. Good work on the dojo, the only thing I was worried about is.. item = db.news_item[request.args[0]] Yes! - this was a quick introduction to the development idioms and phrases used in web2py.. You will also have noticed a line wrap in one of the view slides, which when people typed raised a ticket (HTML injection - newline), which lead to finding the line-wrap in the slides.. So this is (intentionally) not a complete solution, but a beginning to the flavor of developing and writing with web2py. If the request.args[0] tries to call from a non existant SQLRow then it'll throw an error :) Best to apply a try/except method here, but I guess for the purpose of the dojo it was OK (anyone trying to learn from the dojo on here should take notice of this however). On Mar 30, 1:39 am, Yarko Tymciurak yark...@gmail.com wrote: I personally want to thank Massimo for preparing the slides, and Wingware.com for providing a 3-O/S WingIDE-Pro liscense (Jon B. was the winner). The code sprints for PyCon2009 run this week - I'm going to participate after work (since I'm in the Chicago area)... there is a cherrypy sprint, and an old bug I've never had the time to finish tracking down - I hope to do that, and see if I can help the cherrypy folks w/ port to Python3. If you're in the area, be sure to stop by the Crown Plaza for whatever time you can to the sprints. - Yarko On Sun, Mar 29, 2009 at 10:32 PM, mdipierro mdipie...@cs.depaul.edu wrote: Hi everybody, this is a very short summary of what happened at PyCon concerning web2py. I have a lightening talk on Saturday morning. 5 minutes only but I managed to give a demo. There was this panel discussion http://www.b-list.org/weblog/2009/mar/28/pycon-orm-panel/ and I think web2py looked good considering that none of the other ORMs have any short term plan to support GAE. We had a web2py dojo (http://en.wikipedia.org/wiki/Dojo) in the Open Space and we went over this exercise: http://mdp.cti.depaul.edu/examples/static/dojo.pdf We has a good attendance (13 people) and everybody completed the dojo. Nobody run away and we all went for a beer to the bar afterwords. We had very good time. Yarko was there and contributed to develop the slides. Robin was also there. Other people where there but would not know how to match their real names to google usernames (if you attended the dojo, please email me to help me remember you). Barry Hawkins managed the Open Space and opened the dojo. We distributed 102 web2py hats. They are all gone and, believe it not, many people were wearing them. I spend most of my time talking to people and patching the registration software live so I did not have much time to attend talks. I am hoping to catch up by watching the recordings online. I had to leave early today for personal reasons. If you were there feel free to share your opinion with us. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18771] Re: pycon 2009
On Mon, Mar 30, 2009 at 1:38 AM, Yarko Tymciurak yark...@gmail.com wrote: On Mon, Mar 30, 2009 at 1:28 AM, TheDude officed...@gmail.com wrote: Excellent! I wish there was a video, but I'm sure someone has it somewhere on the internet. Good work on the dojo, the only thing I was worried about is.. item = db.news_item[request.args[0]] Yes! - this was a quick introduction to the development idioms and phrases used in web2py.. You will also have noticed a line wrap in one of the view slides, which when people typed raised a ticket (HTML injection - newline), which lead to finding the line-wrap in the slides.. So this is (intentionally) not a complete solution, but a beginning to the flavor of developing and writing with web2py. NOTE that in 2 hours, we downloaded web2py, got an application running, saw tickets, table/controller/view development cycles, came back to add authentication, saw migrations, added services (even found a bug) and got this up and running on appengine (developer sdk). This was a lot in this short time. If the request.args[0] tries to call from a non existant SQLRow then it'll throw an error :) Best to apply a try/except method here, but I guess for the purpose of the dojo it was OK (anyone trying to learn from the dojo on here should take notice of this however). On Mar 30, 1:39 am, Yarko Tymciurak yark...@gmail.com wrote: I personally want to thank Massimo for preparing the slides, and Wingware.com for providing a 3-O/S WingIDE-Pro liscense (Jon B. was the winner). The code sprints for PyCon2009 run this week - I'm going to participate after work (since I'm in the Chicago area)... there is a cherrypy sprint, and an old bug I've never had the time to finish tracking down - I hope to do that, and see if I can help the cherrypy folks w/ port to Python3. If you're in the area, be sure to stop by the Crown Plaza for whatever time you can to the sprints. - Yarko On Sun, Mar 29, 2009 at 10:32 PM, mdipierro mdipie...@cs.depaul.edu wrote: Hi everybody, this is a very short summary of what happened at PyCon concerning web2py. I have a lightening talk on Saturday morning. 5 minutes only but I managed to give a demo. There was this panel discussion http://www.b-list.org/weblog/2009/mar/28/pycon-orm-panel/ and I think web2py looked good considering that none of the other ORMs have any short term plan to support GAE. We had a web2py dojo (http://en.wikipedia.org/wiki/Dojo) in the Open Space and we went over this exercise: http://mdp.cti.depaul.edu/examples/static/dojo.pdf We has a good attendance (13 people) and everybody completed the dojo. Nobody run away and we all went for a beer to the bar afterwords. We had very good time. Yarko was there and contributed to develop the slides. Robin was also there. Other people where there but would not know how to match their real names to google usernames (if you attended the dojo, please email me to help me remember you). Barry Hawkins managed the Open Space and opened the dojo. We distributed 102 web2py hats. They are all gone and, believe it not, many people were wearing them. I spend most of my time talking to people and patching the registration software live so I did not have much time to attend talks. I am hoping to catch up by watching the recordings online. I had to leave early today for personal reasons. If you were there feel free to share your opinion with us. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18768] Re: pycon 2009
Excellent! I wish there was a video, but I'm sure someone has it somewhere on the internet. Good work on the dojo, the only thing I was worried about is.. item = db.news_item[request.args[0]] If the request.args[0] tries to call from a non existant SQLRow then it'll throw an error :) Best to apply a try/except method here, but I guess for the purpose of the dojo it was OK (anyone trying to learn from the dojo on here should take notice of this however). On Mar 30, 1:39 am, Yarko Tymciurak yark...@gmail.com wrote: I personally want to thank Massimo for preparing the slides, and Wingware.com for providing a 3-O/S WingIDE-Pro liscense (Jon B. was the winner). The code sprints for PyCon2009 run this week - I'm going to participate after work (since I'm in the Chicago area)... there is a cherrypy sprint, and an old bug I've never had the time to finish tracking down - I hope to do that, and see if I can help the cherrypy folks w/ port to Python3. If you're in the area, be sure to stop by the Crown Plaza for whatever time you can to the sprints. - Yarko On Sun, Mar 29, 2009 at 10:32 PM, mdipierro mdipie...@cs.depaul.edu wrote: Hi everybody, this is a very short summary of what happened at PyCon concerning web2py. I have a lightening talk on Saturday morning. 5 minutes only but I managed to give a demo. There was this panel discussion http://www.b-list.org/weblog/2009/mar/28/pycon-orm-panel/ and I think web2py looked good considering that none of the other ORMs have any short term plan to support GAE. We had a web2py dojo (http://en.wikipedia.org/wiki/Dojo) in the Open Space and we went over this exercise: http://mdp.cti.depaul.edu/examples/static/dojo.pdf We has a good attendance (13 people) and everybody completed the dojo. Nobody run away and we all went for a beer to the bar afterwords. We had very good time. Yarko was there and contributed to develop the slides. Robin was also there. Other people where there but would not know how to match their real names to google usernames (if you attended the dojo, please email me to help me remember you). Barry Hawkins managed the Open Space and opened the dojo. We distributed 102 web2py hats. They are all gone and, believe it not, many people were wearing them. I spend most of my time talking to people and patching the registration software live so I did not have much time to attend talks. I am hoping to catch up by watching the recordings online. I had to leave early today for personal reasons. If you were there feel free to share your opinion with us. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18772] Re: Would this patch be useful?
Thumbs up. Very good idea! We have had the discussion around MVC. And the conclusion were, that there is no clear-cut border between MVC. No perfect or true division. (Java-) scripting functionality in controllers can ease the way for AJAX forms and functionality in views. On 30 Mar., 06:15, mdipierro mdipie...@cs.depaul.edu wrote: Some clarifications. Right now one can already do this in views by inserting somewhere: script $(document).ready(function() { do_something(); }); /script Mr. Freeze's suggestions has pros and cons. In my opinion: Pros: - it is more compact Cons: - moves into the controller something that (usually) belongs to the view. - if the script in quotes has a bug it may break web2py_ajax because everything would go in the same $(..).ready(function(){}). I would like to hear more opinions about this. Perhaps some examples when this would be better than placing the code in the view. Massimo On Mar 29, 10:46 pm, Jason Brower encomp...@gmail.com wrote: Good question. I like the idea as it gives us a nice place to put scripts and make them apply to the views we want very easily. so +1 on that! Regards, Jason Brower On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote: It's basically a new global list, response.scripts, that is rendered in the jQuery(document).ready function so you can inject javascript from the controller. Massimo mentioned that it may go against MVC separation standards and wanted me to put it out here to get a few opinions. Sample usage: def index(): if not request.vars.name: response.scripts.append($('#messages').text('Messages: Name Missing').css('color','red');) else: response.scripts.append($('#messages').text('Messages: Hello + request.vars.name + ');) return dict() What do you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18773] Re: Would this patch be useful?
On Mon, Mar 30, 2009 at 1:58 AM, notabene niels...@gmail.com wrote: Thumbs up. Very good idea! We have had the discussion around MVC. And the conclusion were, that there is no clear-cut border between MVC. No perfect or true division. I think maybe you missed some point of the discussions on division... one discussion was about where to define forms. I do not think it is ever a good idea to include color settings in controller / business logic... Yarko (Java-) scripting functionality in controllers can ease the way for AJAX forms and functionality in views. On 30 Mar., 06:15, mdipierro mdipie...@cs.depaul.edu wrote: Some clarifications. Right now one can already do this in views by inserting somewhere: script $(document).ready(function() { do_something(); }); /script Mr. Freeze's suggestions has pros and cons. In my opinion: Pros: - it is more compact Cons: - moves into the controller something that (usually) belongs to the view. - if the script in quotes has a bug it may break web2py_ajax because everything would go in the same $(..).ready(function(){}). I would like to hear more opinions about this. Perhaps some examples when this would be better than placing the code in the view. Massimo On Mar 29, 10:46 pm, Jason Brower encomp...@gmail.com wrote: Good question. I like the idea as it gives us a nice place to put scripts and make them apply to the views we want very easily. so +1 on that! Regards, Jason Brower On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote: It's basically a new global list, response.scripts, that is rendered in the jQuery(document).ready function so you can inject javascript from the controller. Massimo mentioned that it may go against MVC separation standards and wanted me to put it out here to get a few opinions. Sample usage: def index(): if not request.vars.name: response.scripts.append($('#messages').text('Messages: Name Missing').css('color','red');) else: response.scripts.append($('#messages').text('Messages: Hello + request.vars.name + ');) return dict() What do you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18776] Re: Would this patch be useful?
On 30 Mar., 09:13, Yarko Tymciurak yark...@gmail.com wrote: On Mon, Mar 30, 2009 at 1:58 AM, notabene niels...@gmail.com wrote: Thumbs up. Very good idea! We have had the discussion around MVC. And the conclusion were, that there is no clear-cut border between MVC. No perfect or true division. I think maybe you missed some point of the discussions on division... one discussion was about where to define forms. I do not think it is ever a good idea to include color settings in controller / business logic... As it is right now You can put color-settings in controllers! I Agree that color-settings hardly never belongs in a controller, but the example from mr.freeze is just a simple example. I believe you could as well put business logic into the script. Regards Niels Bjerre Yarko (Java-) scripting functionality in controllers can ease the way for AJAX forms and functionality in views. On 30 Mar., 06:15, mdipierro mdipie...@cs.depaul.edu wrote: Some clarifications. Right now one can already do this in views by inserting somewhere: script $(document).ready(function() { do_something(); }); /script Mr. Freeze's suggestions has pros and cons. In my opinion: Pros: - it is more compact Cons: - moves into the controller something that (usually) belongs to the view. - if the script in quotes has a bug it may break web2py_ajax because everything would go in the same $(..).ready(function(){}). I would like to hear more opinions about this. Perhaps some examples when this would be better than placing the code in the view. Massimo On Mar 29, 10:46 pm, Jason Brower encomp...@gmail.com wrote: Good question. I like the idea as it gives us a nice place to put scripts and make them apply to the views we want very easily. so +1 on that! Regards, Jason Brower On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote: It's basically a new global list, response.scripts, that is rendered in the jQuery(document).ready function so you can inject javascript from the controller. Massimo mentioned that it may go against MVC separation standards and wanted me to put it out here to get a few opinions. Sample usage: def index(): if not request.vars.name: response.scripts.append($('#messages').text('Messages: Name Missing').css('color','red');) else: response.scripts.append($('#messages').text('Messages: Hello + request.vars.name + ');) return dict() What do you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18778] Re: DAL Insert error
That's not problem of DAL. I just guess some of those inserts failed due to some constraints and that's why the transaction is aborted and rollback should be issued. Michal alias Plysak voltron wrote: Hi, does anyone have an idea what could cause this error? current transaction is aborted, commands ignored until end of transaction block I am trying to make over 2000 inserts at a go, could that be a problem? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18775] DAL Insert error
Hi, does anyone have an idea what could cause this error? current transaction is aborted, commands ignored until end of transaction block I am trying to make over 2000 inserts at a go, could that be a problem? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18774] Re: pycon 2009
On Mar 30, 8:39 am, Yarko Tymciurak yark...@gmail.com wrote: I personally want to thank Massimo for preparing the slides, and Wingware.com for providing a 3-O/S WingIDE-Pro liscense (Jon B. was the winner). Woah, I suppose that's a different Jon B., otherwise I'd probably know about this already! ;) --Jonathan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18779] Re: Possible bug: cron doesn't work when deploy in a directory name with space inside
Try once more, still no cron at all. :-( I describe what I did here, so you can try to reproduce all my test, to see whether it will be any different at your machine. I am now using Windows XP Home Edition (should not matter), Python 2.5.4, web2py source 1.59, ORIGINAL cron.py. I create a brand new test app, then add this stuff. In cron/crontab: */1 * * * * root *applications/test/cron/trigger.py In cron/trigger.py: import urllib,logging,os,sys urllib.urlopen(t).read() In controllers/default.py: def index(): return {} def trigger(): import logging,time logging.warn('Fired') open(C:\marker,a).write('%s\r\n'%time.ctime()) Then, I visit http://127.0.0.1:8000/test several times, once per minute, but see no C:\marker at all. If I visit http://127.0.0.1:8000/test/default/trigger, it can be manually triggered. _ On Mar30, 7:03pm, AchipA attila.cs...@gmail.com wrote: Can you check if the cron tasks really-really aren't executed as per 1.1 ? Logging can play tricks on you in hardcron mode, as a lot of things happen in separate threads. The easiest way is to do something like open(C:\marker,w) and check if it got created or, if it does not annoy you, winsound.Beep(400,400). On Mar 29, 9:08 am, Iceberg iceb...@21cn.com wrote: Hi Achipa, Sorry for delay in response. I managed to upgrade my Python2.4.4 to Python2.6.1 just now, so finally I can play web2py from source. Then I try your patch. The result is, mm, very strange. 1. First I am using Windows XP Home edition, Python 2.6.1, web2py source 1.59, ORIGINAL cron.py (trying to reproduce the problem, but): 1.1 I start web2py.py -a1 -D0 but surprisingly see that cron jobs are not invoked at all. Not any cron-relative info is showed on the console, either. :-o 1.2 However, manually execute web2py.py -C -D0, the external cron can work, NO MATTER the web2py is deployed in a directory with or without white space inside its path.:-/ 2. Then, I try using same infrastructure as above, but replace the cron.py with your patch. Situation is same as above. 3. Later I give up Python2.6.1, reinstall a Python 2.5.4, then redo all the test above. Results remain the same. What should I do now? Sincerely, Iceberg, 2009-Mar-29, 14:19(PM), Sun On Mar25, 9:56pm, AchipA attila.cs...@gmail.com wrote: Ok, could you try replacing your web2py/gluon/contrib/cron.py with http://bazaar.launchpad.net/%7Eachipa/web2py/cron/download/head%3A/cr... and report back if this makes any difference ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18780] session variable as parameter in SQL WHERE clause
Is it possible to use a session variable as a parameter in a SQL WHERE clause? See example below. #assign value to session variable session.mysession = ... #use session variable in web2py DAL query #*this works* rows=db(db.table.column==session.mysession).select(...) #use session variable in SQL query #*this doesn't work* - 'no such column' error #is there any way to do this? rows=db.executesql('SELECT ... FROM ... WHERE table.column = session.mysession;') The obvious answer here is to just use what works (the DAL). However, I have some very complex queries already written in SQL and would rather not have to go to the trouble of morphing them into web2py DAL syntax. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18781] Re: DAL Insert error
Can you say more about the error? or about the insert? On Mar 30, 5:01 am, voltron nhy...@googlemail.com wrote: Hi, does anyone have an idea what could cause this error? current transaction is aborted, commands ignored until end of transaction block I am trying to make over 2000 inserts at a go, could that be a problem? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18782] Re: session variable as parameter in SQL WHERE clause
On Mar 30, 8:51 am, ctalley ctal...@caci.com wrote: Is it possible to use a session variable as a parameter in a SQL WHERE clause? See example below. #assign value to session variable session.mysession = ... #use session variable in web2py DAL query #*this works* rows=db(db.table.column==session.mysession).select(...) this you can do #use session variable in SQL query #*this doesn't work* - 'no such column' error #is there any way to do this? rows=db.executesql('SELECT ... FROM ... WHERE table.column = session.mysession;') this you can but the syntax has to be different and you have to do in a way safe to prevent SQL injections. Should be: from gluon.sql import sql_represent as sanitize rows=db.executesql('SELECT ... FROM ... WHERE table.column = %s;' % sanitize (session.mysession,'string','sqlite') ) The obvious answer here is to just use what works (the DAL). However, I have some very complex queries already written in SQL and would rather not have to go to the trouble of morphing them into web2py DAL syntax. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18783] request for comments
Right now if you say: db.table.field.writable=False your field will be hidden to both custom forms and appadmin forms. I think appadmin forms should ignore these constraints and always display all fields. Do you agree? Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18784] Re: request for comments
agree On Mar 30, 4:10 pm, mdipierro mdipie...@cs.depaul.edu wrote: Right now if you say: db.table.field.writable=False your field will be hidden to both custom forms and appadmin forms. I think appadmin forms should ignore these constraints and always display all fields. Do you agree? Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18785] Re: pycon 2009
:-)John E. from Wingware pulled the name of one of the attendees of the dojo... On Mon, Mar 30, 2009 at 4:36 AM, Jonathan B jonathan.b...@gmail.com wrote: On Mar 30, 8:39 am, Yarko Tymciurak yark...@gmail.com wrote: I personally want to thank Massimo for preparing the slides, and Wingware.com for providing a 3-O/S WingIDE-Pro liscense (Jon B. was the winner). Woah, I suppose that's a different Jon B., otherwise I'd probably know about this already! ;) --Jonathan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18787] Re: Would this patch be useful?
On Mon, Mar 30, 2009 at 5:40 AM, notabene niels...@gmail.com wrote: On 30 Mar., 09:13, Yarko Tymciurak yark...@gmail.com wrote: On Mon, Mar 30, 2009 at 1:58 AM, notabene niels...@gmail.com wrote: Thumbs up. Very good idea! We have had the discussion around MVC. And the conclusion were, that there is no clear-cut border between MVC. No perfect or true division. I think maybe you missed some point of the discussions on division... one discussion was about where to define forms. I do not think it is ever a good idea to include color settings in controller / business logic... As it is right now You can put color-settings in controllers! I Agree that color-settings hardly never belongs in a controller, but the example from mr.freeze is just a simple example. I believe you could as well put business logic into the script. Regards Niels Bjerre I still don't understand what the motivation for this is... if the example is not an example of what makes this more useful than what can be done now, then then I'd like to see one... Yarko (Java-) scripting functionality in controllers can ease the way for AJAX forms and functionality in views. On 30 Mar., 06:15, mdipierro mdipie...@cs.depaul.edu wrote: Some clarifications. Right now one can already do this in views by inserting somewhere: script $(document).ready(function() { do_something(); }); /script Mr. Freeze's suggestions has pros and cons. In my opinion: Pros: - it is more compact Cons: - moves into the controller something that (usually) belongs to the view. - if the script in quotes has a bug it may break web2py_ajax because everything would go in the same $(..).ready(function(){}). I would like to hear more opinions about this. Perhaps some examples when this would be better than placing the code in the view. Massimo On Mar 29, 10:46 pm, Jason Brower encomp...@gmail.com wrote: Good question. I like the idea as it gives us a nice place to put scripts and make them apply to the views we want very easily. so +1 on that! Regards, Jason Brower On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote: It's basically a new global list, response.scripts, that is rendered in the jQuery(document).ready function so you can inject javascript from the controller. Massimo mentioned that it may go against MVC separation standards and wanted me to put it out here to get a few opinions. Sample usage: def index(): if not request.vars.name: response.scripts.append($('#messages').text('Messages: Name Missing').css('color','red');) else: response.scripts.append($('#messages').text('Messages: Hello + request.vars.name + ');) return dict() What do you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18788] Re: request for comments
i also agree On Mar 30, 4:23 pm, Timothy Farrell tfarr...@swgen.com wrote: +1 johann.scheibelho...@easytouch-edv.com wrote: agree On Mar 30, 4:10 pm, mdipierro mdipie...@cs.depaul.edu wrote: Right now if you say: db.table.field.writable=False your field will be hidden to both custom forms and appadmin forms. I think appadmin forms should ignore these constraints and always display all fields. Do you agree? Massimo -- Timothy Farrell tfarr...@swgen.com Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18789] Re: Possible bug: cron doesn't work when deploy in a directory name with space inside
Can't reproduce, apart from misplacing (back)slashes, not sure what it can be. :( Just tried under winXP, from 1.59 source + patch above, (even) with python 2.6. After that experiment I renamed the web2py dir to web py (note the whitespace) and it worked identically. Note that the we both mistyped the marker - open(c:\\marker... is the correct form). My tried and true crontab under windows: */1 * * * * root \python26\python applications\examples\cron\vazeg.py */1 * * * * root *applications\examples \cron\vazeg.py */1 * * * * root *applications/examples/ cron/vazeg.py */1 * * * * root *default/crontest C:\web2py\Python26\python.exe web2py.py -D 0 WARNING:root:no file locking default applications appear to be installed already web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2009 Version 1.59 (2009-03-16 13:10:16) Database drivers available: SQLite3 choose a password:1 please visit: http://127.0.0.1:8000 use kill -SIGTERM 1072 to shutdown the web2py server INFO:root:starting web server... INFO:root:SSL is off DEBUG:root:WEB2PY CRON: Trying to acquire lock DEBUG:root:WEB2PY CRON: Locked INFO:root:WEB2PY CRON (hard): Application: examples executing \python26\python a pplications\examples\cron\vazeg.py in C:\web2py at 2009-03-30 16:48:00.023000 WARNING:root:['\\python26\\python applications\\examples\\cron\ \vazeg.py'] INFO:root:WEB2PY CRON (hard): Application: examples executing *applications\exam ples\cron\vazeg.py in C:\web2py at 2009-03-30 16:48:00.085000 WARNING:root:['C:\\Python26\\python.exe', 'web2py.py', '-P', '-N', '- M', '-S', ' examples', '-a', 'recycle', '-R', 'applications\\examples\\cron\ \vazeg.py'] INFO:root:WEB2PY CRON (hard): Application: examples executing *default/ crontest in C:\web2py at 2009-03-30 16:48:01.101000 DEBUG:root:WEB2PY CRON done INFO:root:WEB2PY CRON Call returned: WARNING:root:crontest_script DEBUG:root:WEB2PY CRON: Releasing cron lock WARNING:root:['C:\\Python26\\python.exe', 'web2py.py', '-P', '-N', '- M', '-S', ' examples/default/crontest', '-a', 'recycle'] ... On Mar 30, 3:07 pm, Iceberg iceb...@21cn.com wrote: Try once more, still no cron at all. :-( I describe what I did here, so you can try to reproduce all my test, to see whether it will be any different at your machine. I am now using Windows XP Home Edition (should not matter), Python 2.5.4, web2py source 1.59, ORIGINAL cron.py. I create a brand new test app, then add this stuff. In cron/crontab: */1 * * * * root *applications/test/cron/trigger.py In cron/trigger.py: import urllib,logging,os,sys urllib.urlopen(t).read() In controllers/default.py: def index(): return {} def trigger(): import logging,time logging.warn('Fired') open(C:\marker,a).write('%s\r\n'%time.ctime()) Then, I visithttp://127.0.0.1:8000/testseveral times, once per minute, but see no C:\marker at all. If I visithttp://127.0.0.1:8000/test/default/trigger, it can be manually triggered. _ On Mar30, 7:03pm, AchipA attila.cs...@gmail.com wrote: Can you check if the cron tasks really-really aren't executed as per 1.1 ? Logging can play tricks on you in hardcron mode, as a lot of things happen in separate threads. The easiest way is to do something like open(C:\marker,w) and check if it got created or, if it does not annoy you, winsound.Beep(400,400). On Mar 29, 9:08 am, Iceberg iceb...@21cn.com wrote: Hi Achipa, Sorry for delay in response. I managed to upgrade my Python2.4.4 to Python2.6.1 just now, so finally I can play web2py from source. Then I try your patch. The result is, mm, very strange. 1. First I am using Windows XP Home edition, Python 2.6.1, web2py source 1.59, ORIGINAL cron.py (trying to reproduce the problem, but): 1.1 I start web2py.py -a1 -D0 but surprisingly see that cron jobs are not invoked at all. Not any cron-relative info is showed on the console, either. :-o 1.2 However, manually execute web2py.py -C -D0, the external cron can work, NO MATTER the web2py is deployed in a directory with or without white space inside its path. :-/ 2. Then, I try using same infrastructure as above, but replace the cron.py with your patch. Situation is same as above. 3. Later I give up Python2.6.1, reinstall a Python 2.5.4, then redo all the test above. Results remain the same. What should I do now? Sincerely, Iceberg, 2009-Mar-29, 14:19(PM), Sun On Mar25, 9:56pm, AchipA attila.cs...@gmail.com wrote: Ok, could you try replacing your web2py/gluon/contrib/cron.py with http://bazaar.launchpad.net/%7Eachipa/web2py/cron/download/head%3A/cr... and report back if this makes any difference ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the
[web2py:18790] Re: request for comments
I agree appadmin should display these fields, BUT I do not thing it should ignore - instead, it should have different behavior: there should be some indicator in appadmin of the permission settings (text, color key, but _something_) On Mon, Mar 30, 2009 at 9:37 AM, Kacper Krupa pageno...@gmail.com wrote: i also agree On Mar 30, 4:23 pm, Timothy Farrell tfarr...@swgen.com wrote: +1 johann.scheibelho...@easytouch-edv.com wrote: agree On Mar 30, 4:10 pm, mdipierro mdipie...@cs.depaul.edu wrote: Right now if you say: db.table.field.writable=False your field will be hidden to both custom forms and appadmin forms. I think appadmin forms should ignore these constraints and always display all fields. Do you agree? Massimo -- Timothy Farrell tfarr...@swgen.com Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18791] Re: request for comments
+1 On Mar 30, 4:37 pm, Kacper Krupa pageno...@gmail.com wrote: i also agree On Mar 30, 4:23 pm, Timothy Farrell tfarr...@swgen.com wrote: +1 johann.scheibelho...@easytouch-edv.com wrote: agree On Mar 30, 4:10 pm, mdipierro mdipie...@cs.depaul.edu wrote: Right now if you say: db.table.field.writable=False your field will be hidden to both custom forms and appadmin forms. I think appadmin forms should ignore these constraints and always display all fields. Do you agree? Massimo -- Timothy Farrell tfarr...@swgen.com Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18792] Re: Would this patch be useful?
The rationale was having the ability to manipulate the DOM from a controller dynamically based on request variables. For example, say you had three input fields on a form, City, State and Zip. When the user submits the form, each piece of data is validated against it's relationship with the other pieces i.e., is the City in the Zip, is the City in the State, is the Zip in the State? Once the offending piece of data is found, I want to use jQuery's animate function to slightly shrink the pieces that are good and turn their backgrounds green. For the data that is bad, I want to use the animate function to make the field bigger and turn it's background red. On Mar 30, 9:23 am, Yarko Tymciurak yark...@gmail.com wrote: On Mon, Mar 30, 2009 at 5:40 AM, notabene niels...@gmail.com wrote: On 30 Mar., 09:13, Yarko Tymciurak yark...@gmail.com wrote: On Mon, Mar 30, 2009 at 1:58 AM, notabene niels...@gmail.com wrote: Thumbs up. Very good idea! We have had the discussion around MVC. And the conclusion were, that there is no clear-cut border between MVC. No perfect or true division. I think maybe you missed some point of the discussions on division... one discussion was about where to define forms. I do not think it is ever a good idea to include color settings in controller / business logic... As it is right now You can put color-settings in controllers! I Agree that color-settings hardly never belongs in a controller, but the example from mr.freeze is just a simple example. I believe you could as well put business logic into the script. Regards Niels Bjerre I still don't understand what the motivation for this is... if the example is not an example of what makes this more useful than what can be done now, then then I'd like to see one... Yarko (Java-) scripting functionality in controllers can ease the way for AJAX forms and functionality in views. On 30 Mar., 06:15, mdipierro mdipie...@cs.depaul.edu wrote: Some clarifications. Right now one can already do this in views by inserting somewhere: script $(document).ready(function() { do_something(); }); /script Mr. Freeze's suggestions has pros and cons. In my opinion: Pros: - it is more compact Cons: - moves into the controller something that (usually) belongs to the view. - if the script in quotes has a bug it may break web2py_ajax because everything would go in the same $(..).ready(function(){}). I would like to hear more opinions about this. Perhaps some examples when this would be better than placing the code in the view. Massimo On Mar 29, 10:46 pm, Jason Brower encomp...@gmail.com wrote: Good question. I like the idea as it gives us a nice place to put scripts and make them apply to the views we want very easily. so +1 on that! Regards, Jason Brower On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote: It's basically a new global list, response.scripts, that is rendered in the jQuery(document).ready function so you can inject javascript from the controller. Massimo mentioned that it may go against MVC separation standards and wanted me to put it out here to get a few opinions. Sample usage: def index(): if not request.vars.name: response.scripts.append($('#messages').text('Messages: Name Missing').css('color','red');) else: response.scripts.append($('#messages').text('Messages: Hello + request.vars.name + ');) return dict() What do you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18793] template unittests ?
While writing some unittests for my controllers, it occured to me that it would be pretty handy to have a unittest like thing for views. So, the use-case would be to construct a controller response (even manually if it's easier) and then preview the template with the given test data. I'm a bit unsure about how such a thing could be properly validated, but IMO it sure would speed up view development. Of course you can do this already by making dummy controllers specifically for this purpose, I'm just thinking that maybe it could be made more elegant. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18794] Re: template unittests ?
we should look into windmill. It really impressed me at PyCon. On Mar 30, 10:39 am, AchipA attila.cs...@gmail.com wrote: While writing some unittests for my controllers, it occured to me that it would be pretty handy to have a unittest like thing for views. So, the use-case would be to construct a controller response (even manually if it's easier) and then preview the template with the given test data. I'm a bit unsure about how such a thing could be properly validated, but IMO it sure would speed up view development. Of course you can do this already by making dummy controllers specifically for this purpose, I'm just thinking that maybe it could be made more elegant. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18795] Re: Would this patch be useful?
On Mon, Mar 30, 2009 at 10:20 AM, mr.freeze nfre...@gmail.com wrote: The rationale was having the ability to manipulate the DOM from a controller dynamically based on request variables. What prevents you from doing this sort of thing in the biew? What makes this better? For example - take flash(): It does not say _where_ it will be displayed, not the color, etc. --- it is only logical. So my question is, why do you need DOM manipulation at controller level? Why are you not doing logical manipulation, and a DOM module for use by view which sets, handles view aspects. Another way to state this: At controller, it makes sense to me to say something that looks like: emphasis('some message'); What empahsis does (color, small, big) - e.g. implementation details of emphasis - I cannot see what advantage there is to push this into controller. In fact, I see much coupling, and many reasons to NOT do that. I still do not see any good motivation for this. - Yarko For example, say you had three input fields on a form, City, State and Zip. When the user submits the form, each piece of data is validated against it's relationship with the other pieces i.e., is the City in the Zip, is the City in the State, is the Zip in the State? Once the offending piece of data is found, I want to use jQuery's animate function to slightly shrink the pieces that are good and turn their backgrounds green. For the data that is bad, I want to use the animate function to make the field bigger and turn it's background red. On Mar 30, 9:23 am, Yarko Tymciurak yark...@gmail.com wrote: On Mon, Mar 30, 2009 at 5:40 AM, notabene niels...@gmail.com wrote: On 30 Mar., 09:13, Yarko Tymciurak yark...@gmail.com wrote: On Mon, Mar 30, 2009 at 1:58 AM, notabene niels...@gmail.com wrote: Thumbs up. Very good idea! We have had the discussion around MVC. And the conclusion were, that there is no clear-cut border between MVC. No perfect or true division. I think maybe you missed some point of the discussions on division... one discussion was about where to define forms. I do not think it is ever a good idea to include color settings in controller / business logic... As it is right now You can put color-settings in controllers! I Agree that color-settings hardly never belongs in a controller, but the example from mr.freeze is just a simple example. I believe you could as well put business logic into the script. Regards Niels Bjerre I still don't understand what the motivation for this is... if the example is not an example of what makes this more useful than what can be done now, then then I'd like to see one... Yarko (Java-) scripting functionality in controllers can ease the way for AJAX forms and functionality in views. On 30 Mar., 06:15, mdipierro mdipie...@cs.depaul.edu wrote: Some clarifications. Right now one can already do this in views by inserting somewhere: script $(document).ready(function() { do_something(); }); /script Mr. Freeze's suggestions has pros and cons. In my opinion: Pros: - it is more compact Cons: - moves into the controller something that (usually) belongs to the view. - if the script in quotes has a bug it may break web2py_ajax because everything would go in the same $(..).ready(function(){}). I would like to hear more opinions about this. Perhaps some examples when this would be better than placing the code in the view. Massimo On Mar 29, 10:46 pm, Jason Brower encomp...@gmail.com wrote: Good question. I like the idea as it gives us a nice place to put scripts and make them apply to the views we want very easily. so +1 on that! Regards, Jason Brower On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote: It's basically a new global list, response.scripts, that is rendered in the jQuery(document).ready function so you can inject javascript from the controller. Massimo mentioned that it may go against MVC separation standards and wanted me to put it out here to get a few opinions. Sample usage: def index(): if not request.vars.name: response.scripts.append($('#messages').text('Messages: Name Missing').css('color','red');) else: response.scripts.append($('#messages').text('Messages: Hello + request.vars.name + ');) return dict() What do you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more
[web2py:18796] Re: template unittests ?
Yes, it looks more Pythonic than Selenium and slightly more powerful (there is actually a sleep (time wait) command). I can't wait to test it out (but I will have to wait for now). mdipierro wrote: we should look into windmill. It really impressed me at PyCon. On Mar 30, 10:39 am, AchipA attila.cs...@gmail.com wrote: While writing some unittests for my controllers, it occured to me that it would be pretty handy to have a unittest like thing for views. So, the use-case would be to construct a controller response (even manually if it's easier) and then preview the template with the given test data. I'm a bit unsure about how such a thing could be properly validated, but IMO it sure would speed up view development. Of course you can do this already by making dummy controllers specifically for this purpose, I'm just thinking that maybe it could be made more elegant. -- Timothy Farrell tfarr...@swgen.com Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18797] Re: Would this patch be useful?
I am siding with Yarko and Massimo on this one. IMHO: 1) It is a valid but unnecessary shortcut, as Massimo said this can be easily done in an alternate slightly longer more explicit way, and explicit is the keyword here, it helps when you are reviewing something you or someone else wrote a while back. 2) And response.scripts can be misleading, not all scripts go under $ (document).ready anyways. Denes. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18798] Re: request for comments
Yes! I was disapointed to find out this wasn't the case and had to go back into my db.py models and change it. +1 :) On Mar 30, 11:11 am, AchipA attila.cs...@gmail.com wrote: +1 On Mar 30, 4:37 pm, Kacper Krupa pageno...@gmail.com wrote: i also agree On Mar 30, 4:23 pm, Timothy Farrell tfarr...@swgen.com wrote: +1 johann.scheibelho...@easytouch-edv.com wrote: agree On Mar 30, 4:10 pm, mdipierro mdipie...@cs.depaul.edu wrote: Right now if you say: db.table.field.writable=False your field will be hidden to both custom forms and appadmin forms. I think appadmin forms should ignore these constraints and always display all fields. Do you agree? Massimo -- Timothy Farrell tfarr...@swgen.com Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18799] Re: template unittests ?
In principle it should be possible to develop a testing app (separate from web2py) that reads and performs unittests from web2py apps. It could also create scaffolding tests by looking at existing controllers, forms and redirect by introspection. Massimo On Mar 30, 11:08 am, Timothy Farrell tfarr...@swgen.com wrote: Yes, it looks more Pythonic than Selenium and slightly more powerful (there is actually a sleep (time wait) command). I can't wait to test it out (but I will have to wait for now). mdipierro wrote: we should look into windmill. It really impressed me at PyCon. On Mar 30, 10:39 am, AchipA attila.cs...@gmail.com wrote: While writing some unittests for my controllers, it occured to me that it would be pretty handy to have a unittest like thing for views. So, the use-case would be to construct a controller response (even manually if it's easier) and then preview the template with the given test data. I'm a bit unsure about how such a thing could be properly validated, but IMO it sure would speed up view development. Of course you can do this already by making dummy controllers specifically for this purpose, I'm just thinking that maybe it could be made more elegant. -- Timothy Farrell tfarr...@swgen.com Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18800] Re: template unittests ?
Err, not really talking about the same thing here. Selenium, Squish, Windmill can be considered unittests for *sites*. As cool and useful as that is, first I'd like to have a component that can just test a view. I don't really see how you would make any of the above suites work around the controllers on it's own (e.g. how would windmill supply you with a pregenerated controller *output* instead of controller *input*). Think about it this way - you have a fancy view that has to fit some fancy data and do some display magic (or generate a form) based on the content, but the controller code that generates the tables is still under development. Not talking about user interaction/simulation here, just plain presentation. Sort of a sanity check for the view to match back to designer specs. On Mar 30, 5:42 pm, mdipierro mdipie...@cs.depaul.edu wrote: we should look into windmill. It really impressed me at PyCon. On Mar 30, 10:39 am, AchipA attila.cs...@gmail.com wrote: While writing some unittests for my controllers, it occured to me that it would be pretty handy to have a unittest like thing for views. So, the use-case would be to construct a controller response (even manually if it's easier) and then preview the template with the given test data. I'm a bit unsure about how such a thing could be properly validated, but IMO it sure would speed up view development. Of course you can do this already by making dummy controllers specifically for this purpose, I'm just thinking that maybe it could be made more elegant. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18801] Re: Would this patch be useful?
I'll defer to group wisdom on this. Thanks for taking a look. On Mar 30, 11:12 am, DenesL denes1...@yahoo.ca wrote: I am siding with Yarko and Massimo on this one. IMHO: 1) It is a valid but unnecessary shortcut, as Massimo said this can be easily done in an alternate slightly longer more explicit way, and explicit is the keyword here, it helps when you are reviewing something you or someone else wrote a while back. 2) And response.scripts can be misleading, not all scripts go under $ (document).ready anyways. Denes. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18802] Re: request for comments
I agree. On Mar 30, 7:28 pm, TheDude officed...@gmail.com wrote: Yes! I was disapointed to find out this wasn't the case and had to go back into my db.py models and change it. +1 :) On Mar 30, 11:11 am, AchipA attila.cs...@gmail.com wrote: +1 On Mar 30, 4:37 pm, Kacper Krupa pageno...@gmail.com wrote: i also agree On Mar 30, 4:23 pm, Timothy Farrell tfarr...@swgen.com wrote: +1 johann.scheibelho...@easytouch-edv.com wrote: agree On Mar 30, 4:10 pm, mdipierro mdipie...@cs.depaul.edu wrote: Right now if you say: db.table.field.writable=False your field will be hidden to both custom forms and appadmin forms. I think appadmin forms should ignore these constraints and always display all fields. Do you agree? Massimo -- Timothy Farrell tfarr...@swgen.com Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18803] Bug in crud.select?
I am trying to use crud.select but am encountering an issue when I customise the list of fields. This code provides a clickable link for the 'id' field, but doesn't have customised headers: table=db.my_table query = table.id 0 fields = [f for f in table.fields if table[f].readable] rows=db(query).select(*fields) headers={} for field in rows.colnames: # Use custom or prettified label headers[field]=table[field].label list=crud.select(table,headers=headers) This code displays customised headers, but doesn't have a clickable 'id' field: list=crud.select(table,fields=fields,headers=headers) The problem appears to be in SQLTABLE (gluon/sqlhtml.py) With the customised list of fields, then we enter this part of the loop: if not table_field.match(colname): I think that the custom headers have somehow changed the value of sqlrows.colnames If I comment this out then it blows up when trying to: (tablename, fieldname) = colname.split('.') I can't see how to get this resolved... Many thanks for any help :) Fran --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18804] search() in T2, [next and previous page], manual Submit required
Pagination works fine when using t2.itemize(), but neither [next page] nor [previous page] works when using t2.search(). It seems they only work when you hit the submit button every time after hitting [next page] or [previous page]. Not intuitive enough. Is there a fix or workaround? like self submitting form? example code would be greatly appreciated on both 1) how to make a form self submitting and 2) a even better solution to the t2.search() next/previous page problem, if it exists Thank you, Hans --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18805] Re: Bug in crud.select?
I will take a look tonight. On Mar 30, 12:21 pm, Fran francisb...@googlemail.com wrote: I am trying to use crud.select but am encountering an issue when I customise the list of fields. This code provides a clickable link for the 'id' field, but doesn't have customised headers: table=db.my_table query = table.id 0 fields = [f for f in table.fields if table[f].readable] rows=db(query).select(*fields) headers={} for field in rows.colnames: # Use custom or prettified label headers[field]=table[field].label list=crud.select(table,headers=headers) This code displays customised headers, but doesn't have a clickable 'id' field: list=crud.select(table,fields=fields,headers=headers) The problem appears to be in SQLTABLE (gluon/sqlhtml.py) With the customised list of fields, then we enter this part of the loop: if not table_field.match(colname): I think that the custom headers have somehow changed the value of sqlrows.colnames If I comment this out then it blows up when trying to: (tablename, fieldname) = colname.split('.') I can't see how to get this resolved... Many thanks for any help :) Fran --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18806] Re: search() in T2, [next and previous page], manual Submit required
Yes it is a bug. It will not be resolved too soon since first we need to merge t2.search with crud.select On Mar 30, 1:03 pm, Hans johann.scheibelho...@easytouch-edv.com wrote: Pagination works fine when using t2.itemize(), but neither [next page] nor [previous page] works when using t2.search(). It seems they only work when you hit the submit button every time after hitting [next page] or [previous page]. Not intuitive enough. Is there a fix or workaround? like self submitting form? example code would be greatly appreciated on both 1) how to make a form self submitting and 2) a even better solution to the t2.search() next/previous page problem, if it exists Thank you, Hans --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18807] strange dict (first) value
I have this db definition: db.define_table('status', SQLField('name'), SQLField('sort_order', 'integer')) I've inserted sample values like: if len(db().select(db.status.ALL)) == 0: db.status.insert(name='New', sort_order=1) db.status.insert(name='Assigned', sort_order=2) db.status.insert(name='Open', sort_order=3) db.status.insert(name='Work In Progress', sort_order=4) db.status.insert(name='Closed', sort_order=5) Then in the controller: status_values={} for status in db().select(db.status.ALL, orderby=db.status.sort_order): status_values[status.id]=status.name form=FORM(TABLE(TR(Status:, status_values.values()[0]))) When I run this as web2py, I get New; but when I run this in google appengine, I get Closed. I am not able to figure this out. Can anyone help me? I want to display the first value. Thanks, Joseph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:/] Re: search() in T2, [next and previous page], manual Submit required
Is there a more practicable temporary workaround than changing the development framework? Can a form submit itself or something similar, how ? Hans On Mar 30, 8:14 pm, mdipierro mdipie...@cs.depaul.edu wrote: Yes it is a bug. It will not be resolved too soon since first we need to merge t2.search with crud.select On Mar 30, 1:03 pm, Hans johann.scheibelho...@easytouch-edv.com wrote: Pagination works fine when using t2.itemize(), but neither [next page] nor [previous page] works when using t2.search(). It seems they only work when you hit the submit button every time after hitting [next page] or [previous page]. Not intuitive enough. Is there a fix or workaround? like self submitting form? example code would be greatly appreciated on both 1) how to make a form self submitting and 2) a even better solution to the t2.search() next/previous page problem, if it exists Thank you, Hans --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18809] Re: strange dict (first) value
We have had problems with things being sorted in reversed order on GAE before. I looked at the web2py and it is correct. I believe this is a GAE bug. @Robin, can you confirm? Massimo On Mar 30, 1:15 pm, Joseph Jude ceph...@gmail.com wrote: I have this db definition: db.define_table('status', SQLField('name'), SQLField('sort_order', 'integer')) I've inserted sample values like: if len(db().select(db.status.ALL)) == 0: db.status.insert(name='New', sort_order=1) db.status.insert(name='Assigned', sort_order=2) db.status.insert(name='Open', sort_order=3) db.status.insert(name='Work In Progress', sort_order=4) db.status.insert(name='Closed', sort_order=5) Then in the controller: status_values={} for status in db().select(db.status.ALL, orderby=db.status.sort_order): status_values[status.id]=status.name form=FORM(TABLE(TR(Status:, status_values.values()[0]))) When I run this as web2py, I get New; but when I run this in google appengine, I get Closed. I am not able to figure this out. Can anyone help me? I want to display the first value. Thanks, Joseph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18810] about primary key field
Hello Only I want to know about of if has been advanced in the topic to define the primary key field when a inherited database is used, instead of using the ID field. It is a latent topic or is a rejected topic? Regards Jose --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18811] t2.display(), reference field representation in view
t2.update() displays reference fields like defined in requires= It retrieves and displays the values from the referenced table. t2.display() does only display the numeric id value of the referenced table. what code is required to get t2.display show values of selected fields in the referenced table instead? code example below. Hans db.define_table('model_category', SQLField('code','string',length=3,required=True, requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB (db,'model_category.code')],unique=True), SQLField('text','string')) db.model_category.represent=lambda model_category: A (model_category.code + ' ' + model_category.text,_href=t2.action ('display_model_category',model_category.id)) db.define_table('model', SQLField('code','string',required=True, requires=IS_NOT_EMPTY(),IS_NOT_IN_DB (db,'model.code')],unique=True), SQLField('description','string',length=64,default=None), SQLField('successor_of','reference model_master', requires=IS_NULL_OR(IS_IN_DB(db,'model.code'))), SQLField('category','reference model_category', requires=IS_NULL_OR(IS_IN_DB(db,'model_category.id','%(code)s % (text)s' def display_model(): item=t2.display(db.model) return dict(item=item) def update_model(): item=t2.update(db.model) return dict(item=item) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18812] Re: [web2py:/] Re: search() in T2, [next and previous page], manual Submit required
you can peek at the code changes I made in the post for t3 foto galleria on http://groups.google.com/group/web2py look at the itemize2 function in t2.py -wj On Mon, Mar 30, 2009 at 12:34 PM, Hans johann.scheibelho...@easytouch-edv.com wrote: Is there a more practicable temporary workaround than changing the development framework? Can a form submit itself or something similar, how ? Hans --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18813] Re: about primary key field
The issue has been raised a few times. It is a complex issue so you should expect a solution early. Massimo On Mar 30, 2:20 pm, Jose jjac...@gmail.com wrote: Hello Only I want to know about of if has been advanced in the topic to define the primary key field when a inherited database is used, instead of using the ID field. It is a latent topic or is a rejected topic? Regards Jose --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18814] documentation
I think we need to re-factor the docstrings in web2py using reST and Sphinx. Anybody good at it willing to take charge for this project? I think it should be a priority. For me this is more important than the WIKI since the current docstrings/epydocs are really limited. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18815] Re: documentation
Massimo, I can't offer up much in form of code/writing/documentation. But if there is any design work needed, please feel free to contact me. It's something i would enjoy doing on the side for sure! thanks, Mike On Mar 30, 5:06 pm, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to re-factor the docstrings in web2py using reST and Sphinx. Anybody good at it willing to take charge for this project? I think it should be a priority. For me this is more important than the WIKI since the current docstrings/epydocs are really limited. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18816] Re: about primary key field
The immediate answer is in your existing database, create a VIEW and map the table(s) you want so that the primary key shows as id, and then connect to that VIEW with web2py. On Mon, Mar 30, 2009 at 3:48 PM, mdipierro mdipie...@cs.depaul.edu wrote: The issue has been raised a few times. It is a complex issue so you should expect a solution early. Massimo On Mar 30, 2:20 pm, Jose jjac...@gmail.com wrote: Hello Only I want to know about of if has been advanced in the topic to define the primary key field when a inherited database is used, instead of using the ID field. It is a latent topic or is a rejected topic? Regards Jose --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18817] Re: documentation
Now that PyCon is (almost) over, I can take this on. - Yarko On Mon, Mar 30, 2009 at 4:06 PM, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to re-factor the docstrings in web2py using reST and Sphinx. Anybody good at it willing to take charge for this project? I think it should be a priority. For me this is more important than the WIKI since the current docstrings/epydocs are really limited. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18818] Re: about primary key field
Not sure this works if the id is not an integer. On Mar 30, 5:42 pm, Yarko Tymciurak yark...@gmail.com wrote: The immediate answer is in your existing database, create a VIEW and map the table(s) you want so that the primary key shows as id, and then connect to that VIEW with web2py. On Mon, Mar 30, 2009 at 3:48 PM, mdipierro mdipie...@cs.depaul.edu wrote: The issue has been raised a few times. It is a complex issue so you should expect a solution early. Massimo On Mar 30, 2:20 pm, Jose jjac...@gmail.com wrote: Hello Only I want to know about of if has been advanced in the topic to define the primary key field when a inherited database is used, instead of using the ID field. It is a latent topic or is a rejected topic? Regards Jose --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18819] Re: documentation
Fantastic Yarko, @Mike. When talking about design, do you refer to CSS? We could very much use that. On Mar 30, 5:49 pm, Yarko Tymciurak yark...@gmail.com wrote: Now that PyCon is (almost) over, I can take this on. - Yarko On Mon, Mar 30, 2009 at 4:06 PM, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to re-factor the docstrings in web2py using reST and Sphinx. Anybody good at it willing to take charge for this project? I think it should be a priority. For me this is more important than the WIKI since the current docstrings/epydocs are really limited. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18820] Multiple checkbox - preselected syntax
I would like someone to help me with the syntax. I want to show pre- selected values in a multiple checkbox form and want to insert this if condition in my FORM stmt. resist = ['A', 'B', 'C', 'D'] r = ['B', 'C'] if r == a.name: status=True # condition to be included #FORM stmt TR(Resistances:, *[TD(x.name, *[INPUT(_type=checkbox, _name=resist_mult,_value=x.name, value=status) for r in a.resist_mult.split('+')]) for x in db().select(db.resist.ALL)]), Kindly let me know if you can do this or have any other solution. thanks, Seb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18821] Re: request for comments
in trunk On Mar 30, 11:49 am, Vidul Petrov vidul.r...@gmail.com wrote: I agree. On Mar 30, 7:28 pm, TheDude officed...@gmail.com wrote: Yes! I was disapointed to find out this wasn't the case and had to go back into my db.py models and change it. +1 :) On Mar 30, 11:11 am, AchipA attila.cs...@gmail.com wrote: +1 On Mar 30, 4:37 pm, Kacper Krupa pageno...@gmail.com wrote: i also agree On Mar 30, 4:23 pm, Timothy Farrell tfarr...@swgen.com wrote: +1 johann.scheibelho...@easytouch-edv.com wrote: agree On Mar 30, 4:10 pm, mdipierro mdipie...@cs.depaul.edu wrote: Right now if you say: db.table.field.writable=False your field will be hidden to both custom forms and appadmin forms. I think appadmin forms should ignore these constraints and always display all fields. Do you agree? Massimo -- Timothy Farrell tfarr...@swgen.com Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18822] Re: Multiple checkbox - preselected syntax
Sorry I do not understand what this is supposed to do. Can you explain it in words. Could you also provide sample values for all the variables? On Mar 30, 7:00 pm, DJ sebastianjaya...@gmail.com wrote: I would like someone to help me with the syntax. I want to show pre- selected values in a multiple checkbox form and want to insert this if condition in my FORM stmt. resist = ['A', 'B', 'C', 'D'] r = ['B', 'C'] if r == a.name: status=True # condition to be included #FORM stmt TR(Resistances:, *[TD(x.name, *[INPUT(_type=checkbox, _name=resist_mult,_value=x.name, value=status) for r in a.resist_mult.split('+')]) for x in db().select(db.resist.ALL)]), Kindly let me know if you can do this or have any other solution. thanks, Seb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18823] Re: documentation
Em Segunda-feira 30 Março 2009, às 19:49:03, Yarko Tymciurak escreveu: Now that PyCon is (almost) over, I can take this on. - Yarko Hi Yarko, Count me in, how do you want to organize things ? On Mon, Mar 30, 2009 at 4:06 PM, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to re-factor the docstrings in web2py using reST and Sphinx. Anybody good at it willing to take charge for this project? I think it should be a priority. For me this is more important than the WIKI since the current docstrings/epydocs are really limited. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18824] Re: request for comments
Em Segunda-feira 30 Março 2009, às 12:07:26, Yarko Tymciurak escreveu: I agree appadmin should display these fields, BUT I do not thing it should ignore - instead, it should have different behavior: there should be some indicator in appadmin of the permission settings (text, color key, but _something_) Im with Yarko in this one. On Mon, Mar 30, 2009 at 9:37 AM, Kacper Krupa pageno...@gmail.com wrote: i also agree On Mar 30, 4:23 pm, Timothy Farrell tfarr...@swgen.com wrote: +1 johann.scheibelho...@easytouch-edv.com wrote: agree On Mar 30, 4:10 pm, mdipierro mdipie...@cs.depaul.edu wrote: Right now if you say: db.table.field.writable=False your field will be hidden to both custom forms and appadmin forms. I think appadmin forms should ignore these constraints and always display all fields. Do you agree? Massimo -- Timothy Farrell tfarr...@swgen.com Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18825] web2py dojo
Here is the source code we used for the web2py Dojo at PyCon. I have no time to add screenshots but, if you decide to try this, could you please send me some screenshots? Even better if you could make a screencast about it. http://mdp.cti.depaul.edu/examples/static/dojo.pdf Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18826] URL mapping - blocking default URLs
All, I have used routes.py for URL mapping and it is working as expected. However I can type the default URLs (/init/default/index, /init/ default/*) on the browser and it still accepts it. How can these default URLs be blocked? Thank you, Joseph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18827] Re: Multiple checkbox - preselected syntax
While running some tests around this I noticed that INPUT is not working properly for checkboxes. INPUT(_type=checkbox,_name=value,_value=1,_checked=ON).xml() 'input name=value type=checkbox value=1 /' INPUT(_type=checkbox,_name=value,_value=1,_checked=True).xml() 'input name=value type=checkbox value=1 /' both results are missing checked='checked' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18828] Re: about primary key field
On 30 mar, 19:42, Yarko Tymciurak yark...@gmail.com wrote: The immediate answer is in your existing database, create a VIEW and map the table(s) you want so that the primary key shows as id, and then connect to that VIEW with web2py. It is an alternative about which had thought. I did a few simple tests and it works well. Thank you very much. Regards Jose --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18829] Re: Multiple checkbox - preselected syntax
Never mind, the correct syntax is with value=True as in: INPUT(_type=checkbox,_name=value,_value=1,value=True).xml() 'input checked=checked name=value type=checkbox value=1 /' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18830] Re: Multiple checkbox - preselected syntax
On Mar 30, 7:00 pm, DJ sebastianjaya...@gmail.com wrote: I would like someone to help me with the syntax. I want to show pre- selected values in a multiple checkbox form and want to insert this if condition in my FORM stmt. resist = ['A', 'B', 'C', 'D'] r = ['B', 'C'] Maybe something like: p=[INPUT(_type=checkbox,_name=resist_mult,_value=x,value=x in r) for x in resist] input name=resist_mult type=checkbox value=A / input checked=checked name=resist_mult type=checkbox value=B / input checked=checked name=resist_mult type=checkbox value=C / input name=resist_mult type=checkbox value=D / --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18831] Re: about primary key field
On Mar 30, 9:11 pm, Jose jjac...@gmail.com wrote: It is an alternative about which had thought. I did a few simple tests and it works well. Thank you very much. Regards Jose Jose, do your test tables have integer indexes?. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18832] Re: Retrieve JSON message send to Server
Hello mate I'm trying to parse the JSON object inside the callback method from my client side, I got a message saying No JSON object could be decoded... Do you please have any idea about what I'm doing wrong in my callback method...Below you can see the sample of the callback method, and format of JSON message... thanks # from the client side I return a JSON that i want to parse: function Save() { var data = $.toJSON( # I convert JSON object to simple text here)); $.ajax({ type: 'POST', url: '{{=URL(r=request,f='action')}}', contentType: application/json; charset=utf-8, data: data, dataType: 'json' success: function(data){ {{ import gluon.contrib.simplejson as sj data = sj.loads(response.body.read()) value = data[Name][0][key1] }} alert({{=value}}); } }); }); } Here is the format of the JSON that is sent as a response from my action client (I can see it from Firebug debuger) { Name: [ { Key1: value1, key2: value2, data: {key: value3} }, { Key1: value1, key2: value2, data: {key: value3} }, ] } Any ideas ? Yannick P. Do you know the On Mar 29, 11:45 am, mdipierro mdipie...@cs.depaul.edu wrote: I think in the action you should do import gluon.contrib.simplejson as sj data=sj.loads(request.body.read()) # then data[Name][0][Key1]==value1 On Mar 29, 10:00 am, Yannick ytchatch...@gmail.com wrote: Thanks a lot for the note and helps I appreciate it... I added the callback on my ajax function... But I still have problem retrieving JSON data...Here is the sample example of the JSON converted to string that i pass to the Action class: { Name: [ { Key1: value1, key2: value2, data: {key: value3} }, { Key1: value1, key2: value2, data: {key: value3} }, ] } I can't retrieve the value using request.vars.Name in my action. The value of this variable is NONE i don't understand why... I'm probably doing something wrong here, do you please have any idea ? Thanks for your attention, Yannick P. On Mar 29, 10:05 am, mdipierro mdipie...@cs.depaul.edu wrote: Is it the same. URL is smart enough On Mar 28, 5:02 pm, Fran francisb...@googlemail.com wrote: On Mar 28, 9:38 pm, Yannick ytchatch...@gmail.com wrote: URL(r=request,c='static/js',f='jquery-1.3.2.js') Should this not be: URL(r=request,c='static',f='js',args=['jquery-1.3.2.js']) F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18833] Re: URL mapping - blocking default URLs
You need to set a rule that maps into an error page. On Mar 30, 8:11 pm, Joseph Jude ceph...@gmail.com wrote: All, I have used routes.py for URL mapping and it is working as expected. However I can type the default URLs (/init/default/index, /init/ default/*) on the browser and it still accepts it. How can these default URLs be blocked? Thank you, Joseph --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18834] Re: documentation
I've looked at http://sphinx.pocoo.org/ext/doctest.html?highlight=doctest#module-sphinx.ext.doctest and the sphinx sources (to see how they are doing this) And it looks like we should just start a branch (I don't see any way to easily share a branch). Give me a day to think about how I want to manage this... On Mon, Mar 30, 2009 at 7:35 PM, Douglas Soares de Andrade dsandr...@gmail.com wrote: Em Segunda-feira 30 Março 2009, às 19:49:03, Yarko Tymciurak escreveu: Now that PyCon is (almost) over, I can take this on. - Yarko Hi Yarko, Count me in, how do you want to organize things ? On Mon, Mar 30, 2009 at 4:06 PM, mdipierro mdipie...@cs.depaul.edu wrote: I think we need to re-factor the docstrings in web2py using reST and Sphinx. Anybody good at it willing to take charge for this project? I think it should be a priority. For me this is more important than the WIKI since the current docstrings/epydocs are really limited. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18835] Re: request for comments
I looked at your post into trunk, Massimo - expedient... but can we have this be something more... functional before next release? I am thinking like this: istead of: ignore_rw=True appadmin would serve better to have something like this: rw.action= some_function() Ignore could be implemented this way... What do you think? On Mon, Mar 30, 2009 at 7:22 PM, mdipierro mdipie...@cs.depaul.edu wrote: in trunk On Mar 30, 11:49 am, Vidul Petrov vidul.r...@gmail.com wrote: I agree. On Mar 30, 7:28 pm, TheDude officed...@gmail.com wrote: Yes! I was disapointed to find out this wasn't the case and had to go back into my db.py models and change it. +1 :) On Mar 30, 11:11 am, AchipA attila.cs...@gmail.com wrote: +1 On Mar 30, 4:37 pm, Kacper Krupa pageno...@gmail.com wrote: i also agree On Mar 30, 4:23 pm, Timothy Farrell tfarr...@swgen.com wrote: +1 johann.scheibelho...@easytouch-edv.com wrote: agree On Mar 30, 4:10 pm, mdipierro mdipie...@cs.depaul.edu wrote: Right now if you say: db.table.field.writable=False your field will be hidden to both custom forms and appadmin forms. I think appadmin forms should ignore these constraints and always display all fields. Do you agree? Massimo -- Timothy Farrell tfarr...@swgen.com Computer Guy Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18836] Re: about primary key field
On Mon, Mar 30, 2009 at 9:30 PM, DenesL denes1...@yahoo.ca wrote: On Mar 30, 9:11 pm, Jose jjac...@gmail.com wrote: It is an alternative about which had thought. I did a few simple tests and it works well. Thank you very much. Regards Jose Jose, do your test tables have integer indexes?. Massimo Denes are right - the PRIMARY KEY constraint will ensure uniqueness on each insert, and most implementations will make the primary key an auto-increment field (in which case you are ok).. But you should check this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups web2py Web Framework group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---