[web2py] Re: boolean field value shows up as gluon.dal.Set object
Well, I ended up having to wipe the db to get this cleared up. That's on the dev machine. Hopefully I won't get bitten when I move to the server, where the real data are. I'm pretty sure it's because of a prior change to the db and some duplicated names from prior iterations that didn't get resolved correctly. Chalk it up to the vicissitudes of making changes to existing db... --
[web2py] Re: How to use maps in plugin_wiki
Hi Margaret, On Monday, 17 September 2012 21:36:47 UTC+1, greaneym wrote: Here is a copy of my model, controller and view files where I got it to work. Great, thanks - just what I needed. You need to obtain a key from google because if more than a default number of people visit your site, you will have to pay them for the use. I forget what is that specific rule, but you can read their policy. This is going to be the sticking point, I think. The issue is that the plugin appears to use the Google Maps v2 API, but this is deprecated and new keys are not available (although existing keys continue to work). -- Cheers, PhilK --
Re: [web2py] how do I pass multiple variables in a Storage object to a function expecting named parameters?
I appreciate the input Anthony. On 18 September 2012 00:37, Anthony abasta...@gmail.com wrote: Sorry, when I replied I only saw Bruno's first reply. I like his option #3 as well. Anthony On Monday, September 17, 2012 3:06:51 PM UTC-4, Carl wrote: Great idea. But if I use Bruno option #3 and avoid adding other functions to the module I won't have to repeat myself. On Monday, 17 September 2012, Anthony wrote: Maybe make a dictionary of functions, then map request.args(0) to the dictionary keys to identify the right function to call (that way if someone tampers with the URL, they can't call any function that's not in the dictionary). Anthony On Monday, September 17, 2012 1:33:26 PM UTC-4, Carl wrote: I've got a request object coming to my Web2py app's controller function. request.args[0] is another function name e.g., blastoff request.vars are parameters e.g., Storage object: {'seconds':10, 'confirm' : 'okay'} how can I call blastoff with the parameters such that I can write blastoff as... def blastoff(seconds, confirm): ... -- -- --
[web2py] Re: Read file attached from gmail
check this: http://stackoverflow.com/questions/8307809/save-email-attachment-python3-pop3-ssl-gmail On Tuesday, September 18, 2012 2:53:35 AM UTC+4:30, visuallinux wrote: Dear All. Every day i did received a email (gmail) with a file attached (text) as rar. My question is how i can read this file attached from web2py? Or how i can download this file to /tmp folder? Any idea. Regards --
[web2py] Presentations + IOError: [Errno 13] with google appengine
Hi everybody! My name is David and I started playing with web2py few days ago. My first impression is definitely positive and I hope to start soon contributing to this wonderful community! Yesterday I built my first app and deployed it with nginx. Works like a charm! :D So, today I wanted to try google appengine. Everything seemed to be working fine, but as soon as I performed a connection to the database I got this error from dev_appserver.py: WARNING 2012-09-18 08:37:03,329 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-packages/setuptools-0.6c11.egg-info: IOError: [Errno 13] file not accessible: '/usr/lib/python2.7/site-packages/setuptools-0.6c11.egg-info' WARNING 2012-09-18 08:37:03,860 dev_appserver_import_hook.py:546] Blocking access to skipped file /home/david/WebDevelopment/content-manager/web2py/gluon/rocket.py Looks like it can't access *setuptools-0.6c11.egg-info*, but such file is there and its permissions are OK. Obviously, the connection to the database doesn't work. So, I edited *dev_appserver_import_hook.py *and changed: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=False): in: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=True): and I got this different error (related to the same origin but imho more specific): WARNING 2012-09-18 09:04:39,300 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-packages/setuptools-0.6c11.egg-info: BadZipfile: File is not a zip file ... Looks like it's looking for a ZIP file and of course * setuptools-0.6c11.egg-info* is not. O_o Operating system: archlinux. Any hints? Tell me if you need more specific information. I wish everybody a wonderful Tuesday! David --
[web2py] Re: SQLFORM.grid, links and buttons placement specification (before other columns, after, or both)
I would love for this to go in the main trunk. (Especially interested in links_placement='left') If this can't go into the release, what is the best way that allows me to make this change in my local web2py installation, as well as keep getting subsequent web2py changes ? -Mandar On Tuesday, April 17, 2012 2:27:04 PM UTC+5:30, nikos wrote: Hello there follow web2py users, First of all, Massimo, thanks for the great work you have done to get web2py to this high level of functionality. I recently started using it for a project and was faced with a challenge: in SQLFORM.grid, when a table has many fields, the users have to scroll to the far right to get to the action buttons, and this has proved cumbersome to them. The same goes for the links that we are allowed to add to the grid. I chose to resolve this issue by adding two extra optional arguments to SQLFORM.grid, namely buttons_placement and links_placement The two are expected to have a value among 'left', 'right', 'both' Both default to 'right' to maintain backward compatibility. If you set them to 'left' the corresponding column(s) will appear at the beginning of the grid (1st column). If you set them to 'right, they will appear at the end (as it was already working) If you set them to 'both', the columns will appear twice, at the beginning and at the end (usefull for large tables where the user can locate the column he wants to decide upon and find a button closeby, either at the beginning or the end) I am attaching a patch against the stock 1.99.7 that I used to begin with. It would be great if some form of this patch would be included in future releases. Again, thanks for all the hard work you all have put into this. Nikos --
[web2py] Check for a value in a table
Dear ALL , How can a check if a value for a Field in a table , now in this i do this values = [] for i in db().select(db.table.ALL): values.append(i.Field) then i check like this : if i in values: . . Is there a better way to do this ?? Best Regards, --
[web2py] sqlform.grid : checkbox in header and confirmation before submit
Hi, I'm using selectable=True in the sqlform.grid. This shows a checkbox in first column for all the rows except the header 1. Is there a way to show the checkbox in the header itself, which when selected selects ALL the rows currently displayed ? I think there is a plugin for this bug that looks old, and not maintained. 2. I also get Submit Query button below the table. I've managed to rename this to Delete Selected - Is there a way to show a confirmation dialog like Are you sure you want to delete all the selected entries (or some such) - before the records are deleted ? Thanks, -Mandar --
[web2py] Re: Check for a value in a table
There are lots of better ways, one would be: count_value = db(db.table.fieldname == value)..count() if not count_value: # Value isn't in db do something Terça-feira, 18 de Setembro de 2012 11:36:11 UTC+1, Hassan Alnatour escreveu: Dear ALL , How can a check if a value for a Field in a table , now in this i do this values = [] for i in db().select(db.table.ALL): values.append(i.Field) then i check like this : if i in values: . . Is there a better way to do this ?? Best Regards, --
[web2py] Re: [ANN] Started development on web2admin
Lots of new customization options and features. Check it out and please report bugs. -rif duminică, 16 septembrie 2012, 13:31:55 UTC+3, rif a scris: Check out the new global search, feedback most welcomed. Features still to come: - Custom Links - Custom Left join -rif sâmbătă, 15 septembrie 2012, 15:38:14 UTC+3, rif a scris: I just thought that one might want to use the manager (without prefix) role for a different propose so I was just playing safe. I agree about namespace pollution. We just need more opinions on this matter (Is it safe to just use manager role or general read/write/etc permissions?). And if we reach a conclusion I am happy to change. Also the the plugin_web2admin-plugin_admin is OK, especially if it will become official :) To others: please give feedback on this. -rif sâmbătă, 15 septembrie 2012, 15:25:27 UTC+3, Alan Etkin a scris: Shouldn't this be called plugin_admin or similar (following the plugin_wiki fashion)? Does w2x_etc naming use any plugin convention?. For instance, in Pyodel (also a plugin) I rely in an application manager role (without a prefix). Maybe we can adopt a standard naming convention for plugin roles. Also, I think that roles with prefixes somehow polute the group space. El lunes, 10 de septiembre de 2012 10:49:35 UTC-3, rif escribió: I started the development of a new django-like admin interface. You can find it here: https://github.com/rif/web2admin It is very basic but still usable because it uses SQLFORM.smartgrid. I am announcing it early because I need your feedback and feature requests so that I can find out if grid will be able to support all the desired features. For quick start you can create a w2a_root group and add your user to that group. -rif --
Re: [web2py] sqlform.grid : checkbox in header and confirmation before submit
On 18 September 2012 12:50, Mandar Vaze mandarv...@gmail.com wrote: Hi, I'm using selectable=True in the sqlform.grid. This shows a checkbox in first column for all the rows except the header 2. I also get Submit Query button below the table. I've managed to rename this to Delete Selected - Is there a way to show a confirmation dialog like Are you sure you want to delete all the selected entries (or some such) - before the records are deleted ? I use this: bevestig = T('Are you sure you want to delete the selected articles?') try: form.element('.web2py_table input[type=submit]')['_value'] = T('Delete selected articles') form.element('.web2py_table input[type=submit]')['_onclick'] = return confirm ('%s') % bevestig except: pass Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) --
Re: [web2py] Re: int() argument must be a string or a number, not 'list'
You should always consider the nightly built. It usually contains most of the fixes as trunk but is a snapshot that we think relatively stable. On Monday, 17 September 2012 22:13:48 UTC-5, Andrew Evans wrote: Will do I saw it was fixed in Trunk Does Trunk mean the not released version? *cheers Andrew --
[web2py] Re: Electronic voting anybody?
None of them. auth.wiki() support the newer MARKMIN which uses the gluon.contrib.autonlinks module which supports the OEMBED protocol. You just add a link to the original youtube video and it will contact the youtube oembed service to ask for the best way to embed it. {{from gluon.contrib.autolinks import expand_one}} *{{=MARKMIN(... http://www.youtube.com/x1w8hKTJ2Cohttp://www.youtube.com/embed/x1w8hKTJ2Co ..., autolinks=lambda link: expand_one(link,{}) )}}* Massimo On Monday, 17 September 2012 23:45:10 UTC-5, apps in tables wrote: Thank you for deciding to add the option. Please, let me understand. Is adding the plugin_wiki to the voting application, will make *{{=MARKMIN(embed:http://www.youtube.com/embed/x1w8hKTJ2Co )}}* or *{{=plugin_wiki.widget('youtube',code='* *x1w8hKTJ2Co * *')}}* possible (understandable) in cleditor? Ashraf --
Re: [web2py] sqlform.grid : checkbox in header and confirmation before submit
http://web2py.com/books/default/search/29?search=FORM.confirm On Tuesday, 18 September 2012 07:10:42 UTC-5, Johann Spies wrote: On 18 September 2012 12:50, Mandar Vaze manda...@gmail.com javascript:wrote: Hi, I'm using selectable=True in the sqlform.grid. This shows a checkbox in first column for all the rows except the header 2. I also get Submit Query button below the table. I've managed to rename this to Delete Selected - Is there a way to show a confirmation dialog like Are you sure you want to delete all the selected entries (or some such) - before the records are deleted ? I use this: bevestig = T('Are you sure you want to delete the selected articles?') try: form.element('.web2py_table input[type=submit]')['_value'] = T('Delete selected articles') form.element('.web2py_table input[type=submit]')['_onclick'] = return confirm ('%s') % bevestig except: pass Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) --
[web2py] Re: Installing Windows Service (2.0.9 Win exe)
For me, 2.0.9 works as described under Windows 7. using the source distribution. (the only thing I changed in the supplied options.py was the server port) Service install and start works as it did previously. On Tuesday, 18 September 2012 02:35:03 UTC+10, Andrew W wrote: I used the nightly build, I'll try the source version next. --
[web2py] 2.0.9 control-f firefox/chrome on mac doesn't work
tried search via control/f in welcome app 2.0.9 stable (firefox and chrome) on mac, and it's not responding. did editor commands change? thanks, Adi --
Re: [web2py] Lazy Options plugin
Will need some code! Richard On Mon, Sep 17, 2012 at 6:48 PM, lyn2py lyn...@gmail.com wrote: Hi! I'm testing the lazy options plugin again, the website is here: http://dev.s-cubism.com/plugin_lazy_options_widget And I find that if 'form has errors', the selected value gets reset instead of being remembered (all the other fields get remembered). The code for form has errors is the simple code from web2py book: form=SQLFORM(db.table) if form.process().accepted: response.flash = 'success' elif form.errors: response.flash = 'form has errors' How do I get the widget to behave like it remembers the selected option? -- --
[web2py] Re: 2.0.9 control-f firefox/chrome on mac doesn't work
Do you mean the admin editor? We replaced it with codemirror so some commands may have changed. Yet search is a browser feature, not a feature of the editor so it should not have changed. On Tuesday, 18 September 2012 08:44:24 UTC-5, Adi wrote: tried search via control/f in welcome app 2.0.9 stable (firefox and chrome) on mac, and it's not responding. did editor commands change? thanks, Adi --
[web2py] Autocomplete widget customized label name and capital letter
How can we do the following ? 1. Use two fields value for the label name db.TDMUSJ00.TRTRKN works fine but I want to do like db.TDMUSJ00.TRTRKN + ( + db.TDMUSJ00.TRTRCD + ) as label name. 2. Look up the data whether it's small or capital letter Value in the database (db.TDMUSJ00.TRTRKN) is all capital and autocomplete doesn't look up the data when user type by small letters. Table 1 db.define_table('TDMUSJ00', Field('TRTRCD', length=8, label=End User Code), Field('TRTSCD', length=3, label=Dept), Field('TRTRKN', length=30, label=Cust Name), primarykey=['TRTRCD']) Table2 db.define_table('EDXUSF00', Field('USDIID', length=5, label=Dist Code), Field('USACCT', length=30, label=Dist End User Code), Field('USUSCD', length=8, label=End User Code), Field('USUPFL', length=1, label=OZ UPLOAD FLAG), Field('USCRBY', length=20, default = auth.user.username.upper() if auth.user else None, label=Created by), Field('USCRDT', 'datetime', default =request.now, label=Created on), Field('USUPBY', length=20, update = auth.user.username.upper() if auth.user else None, label=Updated by), Field('USUPDT', 'datetime', update =request.now, label=Updated on), primarykey=['USDIID', 'USACCT']) db.EDXUSF00.USDIID.requires=IS_IN_DB(db,db.EDMFVF00.FVTKCD,'%(FVNAME)s (%(FVTKCD)s)') db.EDXUSF00.USACCT.requires=[IS_NOT_EMPTY(),IS_LENGTH(30,1),IS_UPPER()] db.EDXUSF00.USUSCD.requires=[IS_IN_DB(db,db.TDMUSJ00.TRTRCD),IS_UPPER()] db.EDXUSF00.USUSCD.widget=SQLFORM.widgets.autocomplete( request, db.TDMUSJ00.TRTRKN+db.TDMUSJ00.TRTRCD, id_field=db.TDMUSJ00.TRTRCD) db.EDXUSF00.USUPFL.writable = db.EDXUSF00.USUPFL.readable = False db.EDXUSF00.USCRBY.writable = False db.EDXUSF00.USCRDT.writable = False db.EDXUSF00.USUPBY.writable = False db.EDXUSF00.USUPDT.writable = False --
[web2py] I need help to setup the domain...
Hello everyone, I need your help!! I don't know how to configure the domain in the routes.py. Which is the regular expression that i need to change this: *http://AN IP ADDRESS/application/controller/function * To that: *http://MY DOMAIN/application/controller/function* ? Thanks in advance. --
[web2py] Re: How to use maps in plugin_wiki
Phil, I don't maintain the plugin, but here's what I did to test to see if it would still work. I made copies of all my files (backup). I read the Google developer page that says that now only businesses have to pay for a key. So if you are learning how to use the api you don't have to pay anything now, it is free. I removed the instances or mentions of GOOGLE_KEY in the model file that came with the web2py plugin, and also in the plugin's index file. In my view I added the reference to google's path for the v3 api like this: {{response.files.append(URL('https://maps.googleapis.com/maps/api/js?sensor=false'))}} {{extend 'layout.html'}} {{=LOAD('plugin_gmap')}} then I saved the file. It loaded with no problems. Also, I think the newest version of web2py has more GIS type features built in with examples, but I haven't got the chance yet to try them out. There might be more discussion about this on the list. Good luck! Margaret On Monday, September 17, 2012 2:10:48 AM UTC-5, Philip Kilner wrote: Hi, I'd like to embed a map in a view, and am trying to use plugin_wiki. I have plugin_wiki installed, and when I use a simpler function, like the YouTube example: - {{=plugin_wiki.widget('youtube',code='l7AWnfFRc7g')}} ...all is well. However, if I try to embed a map, I get a ticket with: - Traceback (most recent call last): File /home/philk/web2py/gluon/restricted.py, line 209, in restricted exec ccode in environment File /home/philk/web2py/applications/myapp/views/property/index.html, line 151, in module AttributeError: 'PluginWiki' object has no attribute 'map' Can anyone clue me in as to what I'm missing? N.B. I'm new to plugins (most of my apps a re simple CRUD), so I may well have overlooked something fundamental. Also, when I get it working I'm a bit confused about the need for an API key - the book says key is the google map api key (default works for 127.0.0.1), but first of all I don't see a default key, and secondly I see from the docs at: - https://developers.google.com/maps/signup ...that the version that needed an API key is deprecated, so I'm concerned that the map plugin itself may be updated. What would really help me out would be a downloadable app that contained a worked example, if there is such a thing. --- Cheers, PhilK --
[web2py] Re: Presentations + IOError: [Errno 13] with google appengine
Could this be a problem of 2.5 vs 2.7? Have you tried 2.5? On Tuesday, 18 September 2012 04:20:16 UTC-5, David Sorrentino wrote: Hi everybody! My name is David and I started playing with web2py few days ago. My first impression is definitely positive and I hope to start soon contributing to this wonderful community! Yesterday I built my first app and deployed it with nginx. Works like a charm! :D So, today I wanted to try google appengine. Everything seemed to be working fine, but as soon as I performed a connection to the database I got this error from dev_appserver.py: WARNING 2012-09-18 08:37:03,329 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-packages/setuptools-0.6c11.egg-info: IOError: [Errno 13] file not accessible: '/usr/lib/python2.7/site-packages/setuptools-0.6c11.egg-info' WARNING 2012-09-18 08:37:03,860 dev_appserver_import_hook.py:546] Blocking access to skipped file /home/david/WebDevelopment/content-manager/web2py/gluon/rocket.py Looks like it can't access *setuptools-0.6c11.egg-info*, but such file is there and its permissions are OK. Obviously, the connection to the database doesn't work. So, I edited *dev_appserver_import_hook.py *and changed: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=False): in: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=True): and I got this different error (related to the same origin but imho more specific): WARNING 2012-09-18 09:04:39,300 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-packages/setuptools-0.6c11.egg-info: BadZipfile: File is not a zip file ... Looks like it's looking for a ZIP file and of course * setuptools-0.6c11.egg-info* is not. O_o Operating system: archlinux. Any hints? Tell me if you need more specific information. I wish everybody a wonderful Tuesday! David --
[web2py] Re: 2.0.9 control-f firefox/chrome on mac doesn't work
Yes, I meant the admin editor. Command-F is a browser search, but Control-F was a working feature of the editor. Something strange is going on my side with code search, but otherwise I like working in the admin editor... Will check codemirror instructions. Thanks Massimo... On Tuesday, September 18, 2012 10:13:01 AM UTC-4, Massimo Di Pierro wrote: Do you mean the admin editor? We replaced it with codemirror so some commands may have changed. Yet search is a browser feature, not a feature of the editor so it should not have changed. On Tuesday, 18 September 2012 08:44:24 UTC-5, Adi wrote: tried search via control/f in welcome app 2.0.9 stable (firefox and chrome) on mac, and it's not responding. did editor commands change? thanks, Adi --
Re: [web2py] HTTPS admin access has stopped working
Thanks to everyone for their replies. Bruno, that is a neat trick. Unfortunately, it didn't solve my problem. I generated a new password and restarted the apache server, but I am seeing the same behavior -- request.is_https is returning false even though I am using https and I cannot use the admin interface. This is harder to solve because https access works locally. It's only on the production apache server (on Elastic Beanstalk) that it fails. Can anyone suggest a strategy to find the cause? A quick survey of the gluon code didn't turn up any obvious place to look. Thanks. David On Monday, September 17, 2012 4:18:34 PM UTC-5, Richard wrote: This is nicer way of restoring it :) Thanks Bruno! Richard On Mon, Sep 17, 2012 at 3:50 PM, Bruno Rocha rocha...@gmail.comjavascript: wrote: assuming your webserver user is www-data and desired password 123456 cd path/to/web2py sudo -u www-data python -c from gluon.main import save_password; save_password('123456',443) -- --
[web2py] Re: 2.0.9 control-f firefox/chrome on mac doesn't work
Please let us know if this is something we can improve or document better. Codemirror was recently integrated and it is possible we have broken some key-bindings. On Tuesday, 18 September 2012 10:22:31 UTC-5, Adi wrote: Yes, I meant the admin editor. Command-F is a browser search, but Control-F was a working feature of the editor. Something strange is going on my side with code search, but otherwise I like working in the admin editor... Will check codemirror instructions. Thanks Massimo... On Tuesday, September 18, 2012 10:13:01 AM UTC-4, Massimo Di Pierro wrote: Do you mean the admin editor? We replaced it with codemirror so some commands may have changed. Yet search is a browser feature, not a feature of the editor so it should not have changed. On Tuesday, 18 September 2012 08:44:24 UTC-5, Adi wrote: tried search via control/f in welcome app 2.0.9 stable (firefox and chrome) on mac, and it's not responding. did editor commands change? thanks, Adi --
[web2py] 2.0.9 web2py.css smartgrid links instead of previous buttons
just updated my previous application 1.9.97 web2py.css with the 2.0.9 and smartgrid default buttons became links. Several custom buttons stayed as buttons. noticed that this code bellow was taken out and replaced with commented part. is there now an other way to create by default smartgrid buttons instead of links? i can keep the old web2py.css and .js, but thought would be good to keep up with latest versions of .css and .js. .web2py_console button { line-height: 20px; margin-right: 5px; display: inline-block; padding: 3px 5px 3px 5px; font-family: 'lucida grande', tahoma, verdana, arial, sans-serif; font-size: 1em; color: #3C3C3D; text-shadow: 1px 1px 0 #FF; background:#ECECEC; white-space: nowrap; overflow: visible; cursor: pointer; text-decoration: none; border: 1px solid #CACACA; -webkit-border-radius: 2px; -moz-border-radius: 2px; -webkit-background-clip: padding-box; border-radius: 2px; outline: none; position: relative; zoom: 1; *display: inline; } /* .web2py_console button { line-height:20px; margin-right:2px; display:inline-block; padding:3px 5px 3px 5px; } */ -- attachment: Wholesale App.jpg
Re: [web2py] HTTPS admin access has stopped working
Can you please print the values of request.env.wsgi_url_scheme and request.env.https It will help me understand what is going on. I do not think we changed the request.is_https behavior. web2py my not be able to detect https if behind a proxy. Massimo On Tuesday, 18 September 2012 10:27:34 UTC-5, David Phillips wrote: Thanks to everyone for their replies. Bruno, that is a neat trick. Unfortunately, it didn't solve my problem. I generated a new password and restarted the apache server, but I am seeing the same behavior -- request.is_https is returning false even though I am using https and I cannot use the admin interface. This is harder to solve because https access works locally. It's only on the production apache server (on Elastic Beanstalk) that it fails. Can anyone suggest a strategy to find the cause? A quick survey of the gluon code didn't turn up any obvious place to look. Thanks. David On Monday, September 17, 2012 4:18:34 PM UTC-5, Richard wrote: This is nicer way of restoring it :) Thanks Bruno! Richard On Mon, Sep 17, 2012 at 3:50 PM, Bruno Rocha rocha...@gmail.com wrote: assuming your webserver user is www-data and desired password 123456 cd path/to/web2py sudo -u www-data python -c from gluon.main import save_password; save_password('123456',443) -- --
Re: [web2py] HTTPS admin access has stopped working
Sure. [Tue Sep 18 15:49:25 2012] [error] WARNING:root:request.env.wsgi_url_scheme: http [Tue Sep 18 15:49:25 2012] [error] WARNING:root:request.env.https: None On Sep 18, 2012, at 10:40 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Can you please print the values of request.env.wsgi_url_scheme and request.env.https It will help me understand what is going on. I do not think we changed the request.is_https behavior. web2py my not be able to detect https if behind a proxy. Massimo On Tuesday, 18 September 2012 10:27:34 UTC-5, David Phillips wrote: Thanks to everyone for their replies. Bruno, that is a neat trick. Unfortunately, it didn't solve my problem. I generated a new password and restarted the apache server, but I am seeing the same behavior -- request.is_https is returning false even though I am using https and I cannot use the admin interface. This is harder to solve because https access works locally. It's only on the production apache server (on Elastic Beanstalk) that it fails. Can anyone suggest a strategy to find the cause? A quick survey of the gluon code didn't turn up any obvious place to look. Thanks. David On Monday, September 17, 2012 4:18:34 PM UTC-5, Richard wrote: This is nicer way of restoring it :) Thanks Bruno! Richard On Mon, Sep 17, 2012 at 3:50 PM, Bruno Rocha rocha...@gmail.com wrote: assuming your webserver user is www-data and desired password 123456 cd path/to/web2py sudo -u www-data python -c from gluon.main import save_password; save_password('123456',443) -- -- --
Re: [web2py] Re: Presentations + IOError: [Errno 13] with google appengine
Apparently it is. Just tried with python 2.5 and it seems to work. I just get an avalanche of warnings every time a load a page. Here an instance: http://pastebin.com/MPZVS1FM Do you know why all this mess happens? Is it related to the handler defined in app.yaml? I used the one present in the scaffolding. Thank you for your help, and thank you very much for all the work you did so far. It's impressive! :) Cheers, David On 18 September 2012 17:01, Massimo Di Pierro massimo.dipie...@gmail.comwrote: Could this be a problem of 2.5 vs 2.7? Have you tried 2.5? On Tuesday, 18 September 2012 04:20:16 UTC-5, David Sorrentino wrote: Hi everybody! My name is David and I started playing with web2py few days ago. My first impression is definitely positive and I hope to start soon contributing to this wonderful community! Yesterday I built my first app and deployed it with nginx. Works like a charm! :D So, today I wanted to try google appengine. Everything seemed to be working fine, but as soon as I performed a connection to the database I got this error from dev_appserver.py: WARNING 2012-09-18 08:37:03,329 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-**packages/setuptools-0.6c11.**egg-info: IOError: [Errno 13] file not accessible: '/usr/lib/python2.7/site-** packages/setuptools-0.6c11.**egg-info' WARNING 2012-09-18 08:37:03,860 dev_appserver_import_hook.py:**546] Blocking access to skipped file /home/david/WebDevelopment/** content-manager/web2py/gluon/**rocket.py Looks like it can't access *setuptools-0.6c11.egg-info*, but such file is there and its permissions are OK. Obviously, the connection to the database doesn't work. So, I edited *dev_appserver_import_hook.py *and changed: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=False): in: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=True): and I got this different error (related to the same origin but imho more specific): WARNING 2012-09-18 09:04:39,300 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-**packages/setuptools-0.6c11.**egg-info: BadZipfile: File is not a zip file ... Looks like it's looking for a ZIP file and of course * setuptools-0.6c11.egg-info* is not. O_o Operating system: archlinux. Any hints? Tell me if you need more specific information. I wish everybody a wonderful Tuesday! David -- --
Re: [web2py] Re: Is there a way to have a widget like list:string on list:reference?
That is true, it is very easy to implement thanks! Another question, is there a way to do not allow empty selections on list:reference? On Sun, Sep 16, 2012 at 1:24 AM, Bruno Rocha rochacbr...@gmail.com wrote: This one:http://ivaynberg.github.com/select2/#infinite It is easy to implement, just a default text box and you bind this. -- -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___ --
[web2py] password file
Hi, I have my site hosted at Justhost.com Now I want to use the admin interface directly so I have added SSL, this seems to work. Going to the topics I can not resolve the last issue admin disabled because unable to access password file. for this I have added parameters_8000.py is the in the cgi directory with 645 security. What am I doing wrong? Regards, Richard --
[web2py] Re: password file
if you access your ewbsite behind ssl that's usually on port 443. so you need to create a parameters_443.py file (either on the server or in your local machine and then upload that one). Il giorno martedì 18 settembre 2012 18:26:13 UTC+2, Richard ha scritto: Hi, I have my site hosted at Justhost.com Now I want to use the admin interface directly so I have added SSL, this seems to work. Going to the topics I can not resolve the last issue admin disabled because unable to access password file. for this I have added parameters_8000.py is the in the cgi directory with 645 security. What am I doing wrong? Regards, Richard --
[web2py] Re: HTTPS admin access has stopped working
You did remember to stop and restart apache after copying the parameters file, right? I ask only because I have overlooked this step. On Monday, September 17, 2012 3:15:40 PM UTC-4, David Phillips wrote: I had a web2py 1.99.7 app running on Elastic Beanstalk. I was able to use the admin interface over https. I then upgraded web2py to 2.0.8 and uploaded it to EB. Now I am getting this message when I try to access the admin interface over HTTPS: ATTENTION: Login requires a secure (HTTPS) connection or running on localhost. Another change I notice is that request.is_https no longer seems to be true. I see that the format of the parameters_*.py file has changed. Is there any reason why I can no longer use the admin interface? Thanks. --
[web2py] Re: password file
443 works better indeed. Thank you. I do get an error ticket now, opening that tickets gives a tickets again :( Op dinsdag 18 september 2012 18:28:40 UTC+2 schreef Niphlod het volgende: if you access your ewbsite behind ssl that's usually on port 443. so you need to create a parameters_443.py file (either on the server or in your local machine and then upload that one). Il giorno martedì 18 settembre 2012 18:26:13 UTC+2, Richard ha scritto: Hi, I have my site hosted at Justhost.com Now I want to use the admin interface directly so I have added SSL, this seems to work. Going to the topics I can not resolve the last issue admin disabled because unable to access password file. for this I have added parameters_8000.py is the in the cgi directory with 645 security. What am I doing wrong? Regards, Richard --
Re: [web2py] Re: Presentations + IOError: [Errno 13] with google appengine
Strange. Are you getting the errors with the SDK or GAE or both? Are most of the errors for pyc files or files in plural_rules? does it look they are always the same files? On Tuesday, 18 September 2012 11:08:44 UTC-5, David Sorrentino wrote: Apparently it is. Just tried with python 2.5 and it seems to work. I just get an avalanche of warnings every time a load a page. Here an instance: http://pastebin.com/MPZVS1FM Do you know why all this mess happens? Is it related to the handler defined in app.yaml? I used the one present in the scaffolding. Thank you for your help, and thank you very much for all the work you did so far. It's impressive! :) Cheers, David On 18 September 2012 17:01, Massimo Di Pierro massimo@gmail.comjavascript: wrote: Could this be a problem of 2.5 vs 2.7? Have you tried 2.5? On Tuesday, 18 September 2012 04:20:16 UTC-5, David Sorrentino wrote: Hi everybody! My name is David and I started playing with web2py few days ago. My first impression is definitely positive and I hope to start soon contributing to this wonderful community! Yesterday I built my first app and deployed it with nginx. Works like a charm! :D So, today I wanted to try google appengine. Everything seemed to be working fine, but as soon as I performed a connection to the database I got this error from dev_appserver.py: WARNING 2012-09-18 08:37:03,329 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-**packages/setuptools-0.6c11.**egg-info: IOError: [Errno 13] file not accessible: '/usr/lib/python2.7/site-** packages/setuptools-0.6c11.**egg-info' WARNING 2012-09-18 08:37:03,860 dev_appserver_import_hook.py:**546] Blocking access to skipped file /home/david/WebDevelopment/** content-manager/web2py/gluon/**rocket.py Looks like it can't access *setuptools-0.6c11.egg-info*, but such file is there and its permissions are OK. Obviously, the connection to the database doesn't work. So, I edited *dev_appserver_import_hook.py *and changed: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=False): in: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=True): and I got this different error (related to the same origin but imho more specific): WARNING 2012-09-18 09:04:39,300 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-**packages/setuptools-0.6c11.**egg-info: BadZipfile: File is not a zip file ... Looks like it's looking for a ZIP file and of course * setuptools-0.6c11.egg-info* is not. O_o Operating system: archlinux. Any hints? Tell me if you need more specific information. I wish everybody a wonderful Tuesday! David -- --
Re: [web2py] HTTPS admin access has stopped working
This confirms my impression. This is not a web2py 2.0.x issue. Something else has changed. env.wsgi_url_scheme and env.https are from the WSGI environment. HTTPS is not defined and WSGI_URL_SCHEME is http. I am suing web2py 2.0.9 with apache and I get request.env.wsgi_url_scheme: https request.env.https: 1 Massimo On Tuesday, 18 September 2012 10:50:55 UTC-5, David Phillips wrote: Sure. [Tue Sep 18 15:49:25 2012] [error] WARNING:root:request.env.wsgi_url_scheme: http [Tue Sep 18 15:49:25 2012] [error] WARNING:root:request.env.https: None On Sep 18, 2012, at 10:40 AM, Massimo Di Pierro massimo@gmail.comjavascript: wrote: Can you please print the values of request.env.wsgi_url_scheme and request.env.https It will help me understand what is going on. I do not think we changed the request.is_https behavior. web2py my not be able to detect https if behind a proxy. Massimo On Tuesday, 18 September 2012 10:27:34 UTC-5, David Phillips wrote: Thanks to everyone for their replies. Bruno, that is a neat trick. Unfortunately, it didn't solve my problem. I generated a new password and restarted the apache server, but I am seeing the same behavior -- request.is_https is returning false even though I am using https and I cannot use the admin interface. This is harder to solve because https access works locally. It's only on the production apache server (on Elastic Beanstalk) that it fails. Can anyone suggest a strategy to find the cause? A quick survey of the gluon code didn't turn up any obvious place to look. Thanks. David On Monday, September 17, 2012 4:18:34 PM UTC-5, Richard wrote: This is nicer way of restoring it :) Thanks Bruno! Richard On Mon, Sep 17, 2012 at 3:50 PM, Bruno Rocha rocha...@gmail.com wrote: assuming your webserver user is www-data and desired password 123456 cd path/to/web2py sudo -u www-data python -c from gluon.main import save_password; save_password('123456',443) -- -- --
[web2py] Re: SQLFORM.grid, links and buttons placement specification (before other columns, after, or both)
+1 needed this since January :) links on left side would be great. https://groups.google.com/d/topic/web2py/ZlxQ3AfWrr4/discussion On Tuesday, April 17, 2012 4:57:04 AM UTC-4, nikos wrote: Hello there follow web2py users, First of all, Massimo, thanks for the great work you have done to get web2py to this high level of functionality. I recently started using it for a project and was faced with a challenge: in SQLFORM.grid, when a table has many fields, the users have to scroll to the far right to get to the action buttons, and this has proved cumbersome to them. The same goes for the links that we are allowed to add to the grid. I chose to resolve this issue by adding two extra optional arguments to SQLFORM.grid, namely buttons_placement and links_placement The two are expected to have a value among 'left', 'right', 'both' Both default to 'right' to maintain backward compatibility. If you set them to 'left' the corresponding column(s) will appear at the beginning of the grid (1st column). If you set them to 'right, they will appear at the end (as it was already working) If you set them to 'both', the columns will appear twice, at the beginning and at the end (usefull for large tables where the user can locate the column he wants to decide upon and find a button closeby, either at the beginning or the end) I am attaching a patch against the stock 1.99.7 that I used to begin with. It would be great if some form of this patch would be included in future releases. Again, thanks for all the hard work you all have put into this. Nikos --
[web2py] Re: password file
The password file didn't have the correct content. Now it contains password= where is my password containing capitals. This is however not the password with which I can login, now I am locked out, I didn't know that web2py could do that! So admin is still not running. Op dinsdag 18 september 2012 19:20:17 UTC+2 schreef Richard het volgende: 443 works better indeed. Thank you. I do get an error ticket now, opening that tickets gives a tickets again :( Op dinsdag 18 september 2012 18:28:40 UTC+2 schreef Niphlod het volgende: if you access your ewbsite behind ssl that's usually on port 443. so you need to create a parameters_443.py file (either on the server or in your local machine and then upload that one). Il giorno martedì 18 settembre 2012 18:26:13 UTC+2, Richard ha scritto: Hi, I have my site hosted at Justhost.com Now I want to use the admin interface directly so I have added SSL, this seems to work. Going to the topics I can not resolve the last issue admin disabled because unable to access password file. for this I have added parameters_8000.py is the in the cgi directory with 645 security. What am I doing wrong? Regards, Richard --
[web2py] Re: Installing Windows Service (2.0.9 Win exe)
Thanks Tim, Just confirming, you used the settings in options_std.py file in web2 py dir, not the ones shown in book. --
[web2py] [ANNOUNCE] PyCon Argentina 2012: Schedule, Early Bird Registration and more...
PyCon Argentina 2012, the 4th National Spanish-speaking Python Conference will be held from November 12th to 17th, in Buenos Aires at the main venue of the National University of Quilmes (Bernal City, in the Great Buenos Aires metropolitan area), Urban Station and EducacionIT (Buenos Aires City downtown). http://ar.pycon.org/2012?lang=en The detailed conference program schedule is available at: http://ar.pycon.org/2012/schedule Admittance is free of charge (web registration is required as venue capacity is limited). To get a conference T-shirt, promotional items and catering, early bird registration is open up to September 30th, 2012 (30% off). Speakers are eligible for a 50% special discount. Additional donations are accepted thorough the payment process (fundraising). First time attendees, students and general public can also opt to register at the gratis rate (free, no cost) to get their badge and program guide. Details in: http://ar.pycon.org/2012/conference/registration?lang=en Sessions will include two days of talks from local and international renowned experts, with inaugural Science Track and “extreme” talks, preceded of one day of tutorial/workshops and three days of sprints meetings. Exhibition hall will include posters and community booths (SOLAR free software civil association, FACTTIC federation of IT cooperatives, Mozilla-Ar, Ubuntu-Ar, PostgreSQL, Hacklabs and “Programming with robots” project from LINTI UNLP). Educational activities ongoing are a Student Works Contest and a Programming Challenge “Learning to program with Robots and Python”, with important awards (including a robot as first prize!). This PyCon Argentina 2012 edition will be held in parallel with two special events: PgDay Argentina 2012 (3rd. intensive one-day PostgreSQL mini conference: http://www.pyday.com.ar/buenosaires2012?lang=en ) and a SugarLabs Day (Education and OLPC), sharing speakers and participants. Finally, there will be open social events to network with speakers, sponsors and attendees: PyCon Reception: buffet pizza-party at the University Campus, on Friday November 16th evening PyCon Closing Party: beer appetizers at Quilmes Brewery Park on Saturday November 17th night Tourist Tour: asado bbq at a rowing club in an island of Tigre, Parana's delta near Buenos Aires, on Sunday November 18th Please contact us if you're interested to attend to the social events (specially the tourist tour), as restrictions apply. Financial Aid would be reopened soon. Accomodation special room rate is also available upon request. Topics: -- Web frameworks (django, web2py, plone, etc.) and “Visual” GUI toolkits Engineering and Scientific Computing (numeric processing and 2D/3D visualization) Python in Education (OLPC, robots, videogames and intro to programming) Databases: realtional, NoSQL and “Cloud” applications Multiprocessing, performance and Python 3 Distinguished international speakers: -- Dr. Massimo Di Pierro - De Paul University (EEUU): web2py web framework, FermiLab QCD, supercomputers Dr. Brett Cannon - Google (EEUU): python core development Mg. Andrea Gavana - Maersk Oil (Dinamarca): wxPython (GUI visual) and 2D/3D Visualization of oil fields Christophe Pettus - PostgreSQL Experts (EEUU): Django web framework and ORMs Craig Kerstiens - Heroku (EEUU): Django web framework and cloud services Shahrokh Mortazavi y Dino Viehland - Microsoft (EEUU): Python Tools for Visual Studio, Azure, PyKinect Erico Andrei - Simples Consultoria (Brasil): Plone CMS - PythonBrasil 10+ additional speakers from U.S.A., Chile, Perú, Brasil, Spain, Cuba and more than 50 presenters from Argentina completes the schedule. Full speaker list is available at: http://ar.pycon.org/2012/activity/speakers There are more than 100+ accepted activities (50+ talks, 20+ posters, 10 sprint projects, 4 tutorials and 7 workshops, 4 plenary sessions, open spaces and special events): http://ar.pycon.org/2012/activity/accepted About PyCon Argentina: --- PyCon Argentina is currently the largest gathering of users and developers of the Spanish-speaking Python Community. With already more than 430 registered participants from around 14 countries including EE.UU., Chile, Peru, Brasil, Uruguay, Colombia, Spain, Paraguay, Mexico, Ecuador, Dinamarca, Cuba y Canada, we expect to exceed 500 attendees (entrepreneurs, professionals, teachers, students and enthusiasts). The event is possible thanks to the generous support of the following sponsors: Grupo MSA, Machinalis, UrbanStation, Microsoft, Lambda Sistemas, Onapsis, Core Security, Grupo 42, Dattatec, Sistemas Ágiles, Thymbra, Liricus, WingWare, EducacionIT y RobotGroup, with special tanks to the Python Software Foundation, PostgreSQL, Google Inc., Maersk Oil, 10Gen, Heroku, Packt Publishing, Python Brasil and Simples Consultoria. PyCon Argentina 2012 is a non-profit community conference, organized by
[web2py] Re: password file
on modern web2py the password file should look like this password=pbkdf2(1000,20,sha512)$858c916eb3bad575$ea6a279d9d32f82f1dddc24aee153669204f05aa You should create a parameters_*.py on your machine using web2py (normally, it would create a parameters_8000.py file) and transfer it to your remote machine. there should be no problem on having a parameters_8000.py from your machine transferred to a parameters_443.py on your remote host. On Tuesday, September 18, 2012 8:47:03 PM UTC+2, Richard wrote: The password file didn't have the correct content. Now it contains password= where is my password containing capitals. This is however not the password with which I can login, now I am locked out, I didn't know that web2py could do that! So admin is still not running. Op dinsdag 18 september 2012 19:20:17 UTC+2 schreef Richard het volgende: 443 works better indeed. Thank you. I do get an error ticket now, opening that tickets gives a tickets again :( Op dinsdag 18 september 2012 18:28:40 UTC+2 schreef Niphlod het volgende: if you access your ewbsite behind ssl that's usually on port 443. so you need to create a parameters_443.py file (either on the server or in your local machine and then upload that one). Il giorno martedì 18 settembre 2012 18:26:13 UTC+2, Richard ha scritto: Hi, I have my site hosted at Justhost.com Now I want to use the admin interface directly so I have added SSL, this seems to work. Going to the topics I can not resolve the last issue admin disabled because unable to access password file. for this I have added parameters_8000.py is the in the cgi directory with 645 security. What am I doing wrong? Regards, Richard --
Re: [web2py] Re: Presentations + IOError: [Errno 13] with google appengine
Oddly enough I'm getting these WARNING/ERRORS just with the SDK. I checked the logs of the GAE and they are cleaned. ;) Yes, all of them are related to the content of the folder *plural_rules*. Yes, it looks like they are always the same files. Appengine is giving me some lemons, but I'm not gonna give up! :) Thank you for your help Massimo. Cheers, David On 18 September 2012 20:22, Massimo Di Pierro massimo.dipie...@gmail.comwrote: Strange. Are you getting the errors with the SDK or GAE or both? Are most of the errors for pyc files or files in plural_rules? does it look they are always the same files? On Tuesday, 18 September 2012 11:08:44 UTC-5, David Sorrentino wrote: Apparently it is. Just tried with python 2.5 and it seems to work. I just get an avalanche of warnings every time a load a page. Here an instance: http://pastebin.com/MPZVS1FM Do you know why all this mess happens? Is it related to the handler defined in app.yaml? I used the one present in the scaffolding. Thank you for your help, and thank you very much for all the work you did so far. It's impressive! :) Cheers, David On 18 September 2012 17:01, Massimo Di Pierro massimo@gmail.comwrote: Could this be a problem of 2.5 vs 2.7? Have you tried 2.5? On Tuesday, 18 September 2012 04:20:16 UTC-5, David Sorrentino wrote: Hi everybody! My name is David and I started playing with web2py few days ago. My first impression is definitely positive and I hope to start soon contributing to this wonderful community! Yesterday I built my first app and deployed it with nginx. Works like a charm! :D So, today I wanted to try google appengine. Everything seemed to be working fine, but as soon as I performed a connection to the database I got this error from dev_appserver.py: WARNING 2012-09-18 08:37:03,329 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-**packag**es/setuptools-0.6c11.**egg-info: IOError: [Errno 13] file not accessible: '/usr/lib/python2.7/site-** packa**ges/setuptools-0.6c11.**egg-**info' WARNING 2012-09-18 08:37:03,860 dev_appserver_import_hook.py:**5**46] Blocking access to skipped file /home/david/WebDevelopment/**co** ntent-manager/web2py/gluon/**roc**ket.py Looks like it can't access *setuptools-0.6c11.egg-info*, but such file is there and its permissions are OK. Obviously, the connection to the database doesn't work. So, I edited *dev_appserver_import_hook.py *and changed: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=False): in: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=True): and I got this different error (related to the same origin but imho more specific): WARNING 2012-09-18 09:04:39,300 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-**packag**es/setuptools-0.6c11.**egg-info: BadZipfile: File is not a zip file ... Looks like it's looking for a ZIP file and of course * setuptools-0.6c11.egg-info* is not. O_o Operating system: archlinux. Any hints? Tell me if you need more specific information. I wish everybody a wonderful Tuesday! David -- -- --
Re: [web2py] HTTPS admin access has stopped working
Thanks for checking, Massimo. I'll start looking into the web server. David On Sep 18, 2012, at 1:30 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: This confirms my impression. This is not a web2py 2.0.x issue. Something else has changed. env.wsgi_url_scheme and env.https are from the WSGI environment. HTTPS is not defined and WSGI_URL_SCHEME is http. I am suing web2py 2.0.9 with apache and I get request.env.wsgi_url_scheme: https request.env.https: 1 Massimo On Tuesday, 18 September 2012 10:50:55 UTC-5, David Phillips wrote: Sure. [Tue Sep 18 15:49:25 2012] [error] WARNING:root:request.env.wsgi_url_scheme: http [Tue Sep 18 15:49:25 2012] [error] WARNING:root:request.env.https: None On Sep 18, 2012, at 10:40 AM, Massimo Di Pierro massimo@gmail.com wrote: Can you please print the values of request.env.wsgi_url_scheme and request.env.https It will help me understand what is going on. I do not think we changed the request.is_https behavior. web2py my not be able to detect https if behind a proxy. Massimo On Tuesday, 18 September 2012 10:27:34 UTC-5, David Phillips wrote: Thanks to everyone for their replies. Bruno, that is a neat trick. Unfortunately, it didn't solve my problem. I generated a new password and restarted the apache server, but I am seeing the same behavior -- request.is_https is returning false even though I am using https and I cannot use the admin interface. This is harder to solve because https access works locally. It's only on the production apache server (on Elastic Beanstalk) that it fails. Can anyone suggest a strategy to find the cause? A quick survey of the gluon code didn't turn up any obvious place to look. Thanks. David On Monday, September 17, 2012 4:18:34 PM UTC-5, Richard wrote: This is nicer way of restoring it :) Thanks Bruno! Richard On Mon, Sep 17, 2012 at 3:50 PM, Bruno Rocha rocha...@gmail.com wrote: assuming your webserver user is www-data and desired password 123456 cd path/to/web2py sudo -u www-data python -c from gluon.main import save_password; save_password('123456',443) -- -- -- --
[web2py] Re: Submitting a form on a jQuery-UI modal
i think you need the ajax_trap parameter to LOAD(): {{=LOAD('default','ajax1.load', ajax=True, user_signature=True, ajax_trap=True)}} if that does not work, can you run the code with a HTTP inspector in the browser to see what URLs are actually being fetched when? i suspect that the LOADed component is not posting to the right URL. cfh On Sunday, September 16, 2012 5:52:12 PM UTC-7, shartha wrote: I have a form containing a text field and the submit button on a jQuery-UI modal. The modal will be shown if the user clicks on a link on the page. If the user clicks on the submit button of the form on the modal, a database row should be updated. However, the form does not get processed successfully if it is loaded on a modal. Here is the code in the controller: *def ajax1():* editDetailsForm = SQLFORM.factory( Field('zip',label=zip), ) if editDetailsForm.process().accepted: response.flash = Accepted db(db.auth_user.id == auth.user.id).update(zip=request.vars[1]) else: response.flash = NOT Accepted return dict(editDetailsForm = editDetailsForm, zip = zip) @auth.requires_login() *def ajax():* return dict() and here is the code in the views: *# for ajax.html:* {{extend 'layout.html'}} {{=LOAD('default','ajax1.load', ajax=True, user_signature=True)}} {{=response.toolbar()}} *# for ajax1.html:* script type=text/javascript $(document).ready(function() { $('div#thedialog').dialog({ autoOpen: false }) $('#thelink').click(function(){ $('div#thedialog').dialog('open'); }); }) /script div id=thedialog title=Download complete {{=editDetailsForm}} /div a href=# id=thelinkClickme/a Please note that the zip field is added to the user table. What baffles me is that if you replace the ajax1 function and ajax1.html with the ajax function and ajax.html, the modal works flawlessly and the database will be successfully updated. Please let me know if my code contains any errors or if you know how to resolve this issue. Thanks! --
Re: [web2py] Re: Presentations + IOError: [Errno 13] with google appengine
Just tried on my ubuntu server and everything works super fine, both with python 2.5 and 2.7. I also tried a vanilla version of archlinux on a virtual machine and nothing changed. I don't know why, but seems like archlinux doesn't like the appengine SDK. :P However, perhaps it's not the best solution ever, but for now I'm going to develop my apps by running the appserver remotely on the ubuntu server. Meanwhile, I'm gonna keep on looking for a solution for my poor arch. :) Thank you one more time for your time and support Massimo! Cheers, David On 18 September 2012 21:10, David Sorrentino sorrentino...@gmail.comwrote: Oddly enough I'm getting these WARNING/ERRORS just with the SDK. I checked the logs of the GAE and they are cleaned. ;) Yes, all of them are related to the content of the folder *plural_rules*. Yes, it looks like they are always the same files. Appengine is giving me some lemons, but I'm not gonna give up! :) Thank you for your help Massimo. Cheers, David On 18 September 2012 20:22, Massimo Di Pierro massimo.dipie...@gmail.comwrote: Strange. Are you getting the errors with the SDK or GAE or both? Are most of the errors for pyc files or files in plural_rules? does it look they are always the same files? On Tuesday, 18 September 2012 11:08:44 UTC-5, David Sorrentino wrote: Apparently it is. Just tried with python 2.5 and it seems to work. I just get an avalanche of warnings every time a load a page. Here an instance: http://pastebin.com/MPZVS1FM Do you know why all this mess happens? Is it related to the handler defined in app.yaml? I used the one present in the scaffolding. Thank you for your help, and thank you very much for all the work you did so far. It's impressive! :) Cheers, David On 18 September 2012 17:01, Massimo Di Pierro massimo@gmail.comwrote: Could this be a problem of 2.5 vs 2.7? Have you tried 2.5? On Tuesday, 18 September 2012 04:20:16 UTC-5, David Sorrentino wrote: Hi everybody! My name is David and I started playing with web2py few days ago. My first impression is definitely positive and I hope to start soon contributing to this wonderful community! Yesterday I built my first app and deployed it with nginx. Works like a charm! :D So, today I wanted to try google appengine. Everything seemed to be working fine, but as soon as I performed a connection to the database I got this error from dev_appserver.py: WARNING 2012-09-18 08:37:03,329 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-**packag**es/setuptools-0.6c11.**egg-info: IOError: [Errno 13] file not accessible: '/usr/lib/python2.7/site-** packa**ges/setuptools-0.6c11.**egg-**info' WARNING 2012-09-18 08:37:03,860 dev_appserver_import_hook.py:**5**46] Blocking access to skipped file /home/david/WebDevelopment/**co** ntent-manager/web2py/gluon/**roc**ket.py Looks like it can't access *setuptools-0.6c11.egg-info*, but such file is there and its permissions are OK. Obviously, the connection to the database doesn't work. So, I edited *dev_appserver_import_hook.py *and changed: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=False): in: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=True): and I got this different error (related to the same origin but imho more specific): WARNING 2012-09-18 09:04:39,300 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-**packag**es/setuptools-0.6c11.**egg-info: BadZipfile: File is not a zip file ... Looks like it's looking for a ZIP file and of course * setuptools-0.6c11.egg-info* is not. O_o Operating system: archlinux. Any hints? Tell me if you need more specific information. I wish everybody a wonderful Tuesday! David -- -- --
Re: [web2py] HTTPS admin access has stopped working
Apache is an big beast, zillions of options... It could that HTTPS env var in apache is not passed to WSGI. Check: https://httpd.apache.org/docs/2.2/mod/mod_ssl.html#ssloptions StdEnvVars must be enabled mic 2012/9/18 David Phillips david.phillips@gmail.com: Thanks for checking, Massimo. I'll start looking into the web server. David On Sep 18, 2012, at 1:30 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: This confirms my impression. This is not a web2py 2.0.x issue. Something else has changed. env.wsgi_url_scheme and env.https are from the WSGI environment. HTTPS is not defined and WSGI_URL_SCHEME is http. I am suing web2py 2.0.9 with apache and I get request.env.wsgi_url_scheme: https request.env.https: 1 Massimo On Tuesday, 18 September 2012 10:50:55 UTC-5, David Phillips wrote: Sure. [Tue Sep 18 15:49:25 2012] [error] WARNING:root:request.env.wsgi_url_scheme: http [Tue Sep 18 15:49:25 2012] [error] WARNING:root:request.env.https: None On Sep 18, 2012, at 10:40 AM, Massimo Di Pierro massimo@gmail.com wrote: Can you please print the values of request.env.wsgi_url_scheme and request.env.https It will help me understand what is going on. I do not think we changed the request.is_https behavior. web2py my not be able to detect https if behind a proxy. Massimo On Tuesday, 18 September 2012 10:27:34 UTC-5, David Phillips wrote: Thanks to everyone for their replies. Bruno, that is a neat trick. Unfortunately, it didn't solve my problem. I generated a new password and restarted the apache server, but I am seeing the same behavior -- request.is_https is returning false even though I am using https and I cannot use the admin interface. This is harder to solve because https access works locally. It's only on the production apache server (on Elastic Beanstalk) that it fails. Can anyone suggest a strategy to find the cause? A quick survey of the gluon code didn't turn up any obvious place to look. Thanks. David On Monday, September 17, 2012 4:18:34 PM UTC-5, Richard wrote: This is nicer way of restoring it :) Thanks Bruno! Richard On Mon, Sep 17, 2012 at 3:50 PM, Bruno Rocha rocha...@gmail.com wrote: assuming your webserver user is www-data and desired password 123456 cd path/to/web2py sudo -u www-data python -c from gluon.main import save_password; save_password('123456',443) -- -- -- -- --
Re: [web2py] Re: Presentations + IOError: [Errno 13] with google appengine
I think the problem is that you are running web2py with 2.7 and the sdk with 2.5. I suspect when 2.5 finds the pyc created with 2.7 it complains. GAE does not complain because the pyc are not deployed. Try delete all the pyc files, restart the SDK and it should not complain. On Tuesday, 18 September 2012 14:10:52 UTC-5, David Sorrentino wrote: Oddly enough I'm getting these WARNING/ERRORS just with the SDK. I checked the logs of the GAE and they are cleaned. ;) Yes, all of them are related to the content of the folder *plural_rules*. Yes, it looks like they are always the same files. Appengine is giving me some lemons, but I'm not gonna give up! :) Thank you for your help Massimo. Cheers, David On 18 September 2012 20:22, Massimo Di Pierro massimo@gmail.comjavascript: wrote: Strange. Are you getting the errors with the SDK or GAE or both? Are most of the errors for pyc files or files in plural_rules? does it look they are always the same files? On Tuesday, 18 September 2012 11:08:44 UTC-5, David Sorrentino wrote: Apparently it is. Just tried with python 2.5 and it seems to work. I just get an avalanche of warnings every time a load a page. Here an instance: http://pastebin.com/MPZVS1FM Do you know why all this mess happens? Is it related to the handler defined in app.yaml? I used the one present in the scaffolding. Thank you for your help, and thank you very much for all the work you did so far. It's impressive! :) Cheers, David On 18 September 2012 17:01, Massimo Di Pierro massimo@gmail.comwrote: Could this be a problem of 2.5 vs 2.7? Have you tried 2.5? On Tuesday, 18 September 2012 04:20:16 UTC-5, David Sorrentino wrote: Hi everybody! My name is David and I started playing with web2py few days ago. My first impression is definitely positive and I hope to start soon contributing to this wonderful community! Yesterday I built my first app and deployed it with nginx. Works like a charm! :D So, today I wanted to try google appengine. Everything seemed to be working fine, but as soon as I performed a connection to the database I got this error from dev_appserver.py: WARNING 2012-09-18 08:37:03,329 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-**packag**es/setuptools-0.6c11.**egg-info: IOError: [Errno 13] file not accessible: '/usr/lib/python2.7/site-** packa**ges/setuptools-0.6c11.**egg-**info' WARNING 2012-09-18 08:37:03,860 dev_appserver_import_hook.py:**5**46] Blocking access to skipped file /home/david/WebDevelopment/**co** ntent-manager/web2py/gluon/**roc**ket.py Looks like it can't access *setuptools-0.6c11.egg-info*, but such file is there and its permissions are OK. Obviously, the connection to the database doesn't work. So, I edited *dev_appserver_import_hook.py *and changed: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=False): in: def IsFileAccessible(filename, normcase=os.path.normcase, py27_optional=True): and I got this different error (related to the same origin but imho more specific): WARNING 2012-09-18 09:04:39,300 py_zipimport.py:139] Can't open zipfile /usr/lib/python2.7/site-**packag**es/setuptools-0.6c11.**egg-info: BadZipfile: File is not a zip file ... Looks like it's looking for a ZIP file and of course * setuptools-0.6c11.egg-info* is not. O_o Operating system: archlinux. Any hints? Tell me if you need more specific information. I wish everybody a wonderful Tuesday! David -- -- --
Re: [web2py] HTTPS admin access has stopped working
Try: IfModule mod_setenvif.c SetEnvIf X-Forwarded-Proto https HTTPS=1 /IfModule I had a similar issue and posted on the wsgi group: https://groups.google.com/forum/?fromgroups=#!topic/modwsgi/Egi6pg7c2X8 Regards, Andrew On Tuesday, September 18, 2012 2:19:41 PM UTC-5, David Phillips wrote: Thanks for checking, Massimo. I'll start looking into the web server. David On Sep 18, 2012, at 1:30 PM, Massimo Di Pierro massimo@gmail.comjavascript: wrote: This confirms my impression. This is not a web2py 2.0.x issue. Something else has changed. env.wsgi_url_scheme and env.https are from the WSGI environment. HTTPS is not defined and WSGI_URL_SCHEME is http. I am suing web2py 2.0.9 with apache and I get request.env.wsgi_url_scheme: https request.env.https: 1 Massimo On Tuesday, 18 September 2012 10:50:55 UTC-5, David Phillips wrote: Sure. [Tue Sep 18 15:49:25 2012] [error] WARNING:root:request.env.wsgi_url_scheme: http [Tue Sep 18 15:49:25 2012] [error] WARNING:root:request.env.https: None On Sep 18, 2012, at 10:40 AM, Massimo Di Pierro massimo@gmail.com wrote: Can you please print the values of request.env.wsgi_url_scheme and request.env.https It will help me understand what is going on. I do not think we changed the request.is_https behavior. web2py my not be able to detect https if behind a proxy. Massimo On Tuesday, 18 September 2012 10:27:34 UTC-5, David Phillips wrote: Thanks to everyone for their replies. Bruno, that is a neat trick. Unfortunately, it didn't solve my problem. I generated a new password and restarted the apache server, but I am seeing the same behavior -- request.is_https is returning false even though I am using https and I cannot use the admin interface. This is harder to solve because https access works locally. It's only on the production apache server (on Elastic Beanstalk) that it fails. Can anyone suggest a strategy to find the cause? A quick survey of the gluon code didn't turn up any obvious place to look. Thanks. David On Monday, September 17, 2012 4:18:34 PM UTC-5, Richard wrote: This is nicer way of restoring it :) Thanks Bruno! Richard On Mon, Sep 17, 2012 at 3:50 PM, Bruno Rocha rocha...@gmail.comwrote: assuming your webserver user is www-data and desired password 123456 cd path/to/web2py sudo -u www-data python -c from gluon.main import save_password; save_password('123456',443) -- -- -- --
Re: [web2py] Re: Best Method to implement a like button
Thanks for the response guys! I'm going with rochabruno's method as it is the most straightfoward, I hadn't really looked into the compute capabilities. On Tuesday, September 11, 2012 3:55:21 PM UTC-7, rochacbruno wrote: The computation should be compute= lambda row: %(username)s-%(songname)s-%(playlist_name)s % row --
[web2py] Odd bootstrap.js behavior while updating AppointmentManager appliance
I'm interested in using the Appointment Manager appliance ( https://github.com/mdipierro/web2py-appliances/tree/master/AppointmentManager) in conjunction with the latest layout/css/js. I replaced the appliance's /views/layout.html and static/css with that from the welcome application in Web2Py 2.09, adding back in the fullcalendar.css from the original. I also added the three share images to the appliance's /static/images folder. Everything looked okay and seemed to function normally. I hadn't added in the bootstrap.min.js yet, however. After doing so, the month-selection widget and calendar in mysite/AppointmentManager/mycal both appear twice. It's not in the html as such, but is apparently rendered twice via javascript. I've fiddled with this for a bit and cannot seem to straighten it out. I've uploaded an image of its current appearance. Without bootstrap.min.js included, it's just one calendar and month selector. Any thoughts? -- attachment: calendar-js-weirdness-2.png.png
[web2py] how to access auth_user.email to send an email
Hello, In testing the registration on my app, I am confused about how to send a new user an email. When a new user is registering using the defaults that come with web2py, I can see in the db that for a new user, there is a field db.auth_user.email, so I am trying to use that to send a mail to the new user, and using the logging mechanism to test. in the model db.py I try adding this: newuser = db(db.auth_user.email==email).select() mail.send(to=['newuser'], subject='Welcome, etc.', # If reply_to is omitted, then mail.settings.sender is used reply_to='myemailaddr...@gmail.com', message='You will be able to login when you receive another email stat ing that the registration is completed.'), Also tried mail.send(to'['db.auth_user.email'], in both cases the To: field gets populated with exactly those fields, To: newuser or To: db.auth_user.email How do I access this variable please? I don't see an example in the book or the cookbook, or in the web2py-users group that explains in a way I understand. thanks for any help, Margaret --
[web2py] fancybox forms issue
Hi everyone, i try not to ask here before googling my issues but so far i haven't found solution for this one: i have this in my model db.py db.define_table('person', Field('first_name'), Field('last_name'), Field('address'), Field('phone'), Field('email'), ) in my controller i have: registration.py def person(): form = SQLFORM(db.person) if form.process().accepts: response.flash=text elif form.errors: response.flash=another text else: response.flash=load your personal information please return dict(form=form) def index(): return dict() now comes the heavy part, i want to use fancybox to show my registration/person form in my registration/index i have the following code: index.html 1|{{extend 'layout.html'}} 2|{{include 'web2py_ajax.html'}} 3| 4|script type=text/javascript src=../static/js/fancybox.js/script 5| 6|link href=../static/css/fancybox.css rel=stylesheet type=text/css 7|script type=text/javascript 8|$(document).ready(function(){ 9|$('.frame').fancybox({ 10|width:'98%', 11|height:'98%', 12|}); //end iframe 13|}); //end ready 14|/script 15| 16| 17| 18|ul 19| li{{=A('link',callback=URL('registration','person'), _class=frame)}}/li 20|/ul and simply it does not work, when i click the link it says The requested content cannot be loaded. Please try again later. in the box, i have tried to link the file in line 4 inside of layout.html and still doesn't work, after a long time i'm starting to think that it may be a permission issue since y have tested this possibilities too: a class=frame onclick=ajax('/myapp/registration/person',[],'');return false href=#nullNew Person/a still nothing, and no errors show up in firebug, hints? --
[web2py] Re: Odd bootstrap.js behavior while updating AppointmentManager appliance
Sorry, I forgot to include that I also had edited /views/default/appointment_read.html, commenting out the {{for t,f in db.t_appointment._referenced_by:}} loop, thus permitting the appliance to function. (it creates a too many values to unpack error) On Tuesday, September 18, 2012 7:11:55 PM UTC-5, dhmorgan wrote: I'm interested in using the Appointment Manager appliance ( https://github.com/mdipierro/web2py-appliances/tree/master/AppointmentManager) in conjunction with the latest layout/css/js. I replaced the appliance's /views/layout.html and static/css with that from the welcome application in Web2Py 2.09, adding back in the fullcalendar.css from the original. I also added the three share images to the appliance's /static/images folder. Everything looked okay and seemed to function normally. I hadn't added in the bootstrap.min.js yet, however. After doing so, the month-selection widget and calendar in mysite/AppointmentManager/mycal both appear twice. It's not in the html as such, but is apparently rendered twice via javascript. I've fiddled with this for a bit and cannot seem to straighten it out. I've uploaded an image of its current appearance. Without bootstrap.min.js included, it's just one calendar and month selector. Any thoughts? --
[web2py] Re: how to access auth_user.email to send an email
In mail.send(), the to argument has to be a list of actual email addresses. You are giving it a string that is the name of a variable that holds a DAL Rows object (but it treats the string itself as the email address). You want something more like: newuser = db(db.auth_user.email==email).select().first() mail.send(to=[newuser.email], ...) Anthony On Tuesday, September 18, 2012 8:51:09 PM UTC-4, greaneym wrote: Hello, In testing the registration on my app, I am confused about how to send a new user an email. When a new user is registering using the defaults that come with web2py, I can see in the db that for a new user, there is a field db.auth_user.email, so I am trying to use that to send a mail to the new user, and using the logging mechanism to test. in the model db.py I try adding this: newuser = db(db.auth_user.email==email).select() mail.send(to=['newuser'], subject='Welcome, etc.', # If reply_to is omitted, then mail.settings.sender is used reply_to='myemail...@gmail.com javascript:', message='You will be able to login when you receive another email stat ing that the registration is completed.'), Also tried mail.send(to'['db.auth_user.email'], in both cases the To: field gets populated with exactly those fields, To: newuser or To: db.auth_user.email How do I access this variable please? I don't see an example in the book or the cookbook, or in the web2py-users group that explains in a way I understand. thanks for any help, Margaret --
[web2py] Can't import module ?
HI, I install python-tesseract (http://code.google.com/p/python-tesseract/downloads/detail?name=python-tesseract-0.7.6.win32-py2.7.execan=2q=), it's work fine on Python interpreter (Win32). But, i can't import tesseract module on web2py source code version 2.0.9. What did I do wrong? Thanks. Traceback (most recent call last): File D:\web2py2.0\gluon\restricted.py, line 209, in restricted exec ccode in environment File D:/web2py2.0/applications/app/controllers/plugin_qa.py http://127.0.0.1:8000/admin/default/edit/app/controllers/plugin_qa.py, line 101, in module File D:\web2py2.0\gluon\globals.py, line 186, in lambda self._caller = lambda f: f() File D:/web2py2.0/applications/app/controllers/plugin_qa.py http://127.0.0.1:8000/admin/default/edit/app/controllers/plugin_qa.py, line 81, in index import tesseract File D:\web2py2.0\gluon\custom_import.py, line 298, in __call__ raise e ImportError: Cannot import module 'tesseract' My controller: def index(): import tesseract api = tesseract.TessBaseAPI() api.Init(.,eng,tesseract.OEM_DEFAULT) api.SetVariable(tessedit_char_whitelist, 0123456789abcdefghijklmnopqrstuvwxyz) api.SetPageSegMode(tesseract.PSM_AUTO) mImgFile = E:\test.png mBuffer=open(mImgFile,rb).read() result = tesseract.ProcessPagesBuffer(mBuffer,len(mBuffer),api) print result(ProcessPagesBuffer)=,result response.view = 'plugin_app/content.%s'%request.extension content = result return dict(content=content) --
[web2py] Can't import (tesseract) module ?
HI, I install python-tesseract-0.7.6.win32-py2.7.exehttp://code.google.com/p/python-tesseract/downloads/detail?name=python-tesseract-0.7.6.win32-py2.7.execan=2q=and it's work fine on Python interpreter. But i can't import module on web2py source code version 2.0.9 What did I do wrong? Thanks. My controller def index(): import tesseract api = tesseract.TessBaseAPI() api.Init(.,eng,tesseract.OEM_DEFAULT) api.SetVariable(tessedit_char_whitelist, 0123456789abcdefghijklmnopqrstuvwxyz) api.SetPageSegMode(tesseract.PSM_AUTO) mImgFile = E:\test.png mBuffer=open(mImgFile,rb).read() result = tesseract.ProcessPagesBuffer(mBuffer,len(mBuffer),api) print result(ProcessPagesBuffer)=,result Traceback (most recent call last): File D:\web2py2.0\gluon\restricted.py, line 209, in restricted exec ccode in environment File D:/web2py2.0/applications/app/controllers/plugin_qa.py http://127.0.0.1:8000/admin/default/edit/app/controllers/plugin_qa.py, line 101, in module File D:\web2py2.0\gluon\globals.py, line 186, in lambda self._caller = lambda f: f() File D:/web2py2.0/applications/app/controllers/plugin_qa.py http://127.0.0.1:8000/admin/default/edit/app/controllers/plugin_qa.py, line 81, in index import tesseract File D:\web2py2.0\gluon\custom_import.py, line 298, in __call__ raise e ImportError: Cannot import module 'tesseract' --
[web2py] Re: Lighttpd setup
I didn't manage to configure Web2py with this web server (each step was followed and the only result was directory listing, of course when enabled). I'm using web2py + lighttpd for some time. Here's my setup used: http://blog.aplikacja.info/2012/02/leb2py-lighttpd-deploytment/ --
[web2py] Re: SQLTABLE: how to customise it?
How do I give a label to calculated fields, like if I used: rows = db().select(db.hvmt2.hub,db.*hvmt2.bytes_total.sum()*, groupby=db.hvmt2.hub, cacheable=True) I want to serialize rows as: Result=SQLTABLE(rows,headers={'hvmt2.hub':'HUB',*'hvmt2.bytes_total.sum()'*:'USAGE in MB'},truncate=60) But the summed column (what I referred to above as 'calculated') gets displayed as SUM(hvmt2.bytes_total) not 'USAGE in MB' as I desire. Thanks, mave On Thursday, January 21, 2010 5:36:17 AM UTC-8, Johann Spies wrote: I would like the table produced by SQLTABLE to have different column labels (e.g. Name for db.person.name). How do I do it? Also: I would like the output of SQLTABLE to provide links to individual records simliar to what appadmin does. I could not fully understand the code appadmin uses to achieve this. Can linkto be used in this case? From what I understand from te book linkto is a SQLFORM method and is not related to SQLTABLE. Regards Johann --
[web2py] Re: response.stream and web2py_component
Yes it was the older version. Thanks for your suggestions guys, I used a combination of response.js and frame to render the response and also open a save as dialog.. In short: in form_query(): response.js = jQuery('#ddl').attr('src','form_query_download') And form_query_download(): code to re run the query or read from session after storing rows using rows.as_list() and stream results as a csv file: #ddl refers to the id of an empty iframe thats invisible. mave On Wednesday, September 12, 2012 4:41:21 AM UTC-7, Anthony wrote: Are you using the latest version of web2py? That's a new option. On Wednesday, September 12, 2012 4:43:50 AM UTC-4, maverick wrote: Anthony, Thanks for the explanation. I tried cacheable=True in my select(), like: rows = db().select(db.vmt_weekly.ALL, cacheable=True) but it is met with internal error: type 'exceptions.SyntaxError' invalid select attribute: cacheable Is there something I'm missing? mave On Tuesday, September 11, 2012 10:17:48 PM UTC-7, Anthony wrote: Can you show me how I could modify form_query() to embed JS (if I've understood your second option correctly) in order to trigger the download? You're not going to be able to have a single call to form_query both return HTML content and stream a file at the same time -- those are two separate HTTP responses, so you need two separate requests. Return the HTML first, and then request the file separately. If you don't want to repeat the query to re-generate the rows object again, in your select(), add cacheable=True. That will allow you to store rows in the session when form_query is called. Your subsequent call to fetch the file can then retrieve rows from the session, convert to csv, and then stream. Anthony --
[web2py] Re: SQLTABLE: how to customise it?
Should not be *{, 'hvmt2.bytes_total.sum()'*:'USAGE in MB'} but {., str(db.*hvmt2.bytes_total.sum())*:'USAGE in MB'} On Tuesday, 18 September 2012 01:23:58 UTC-5, maverick wrote: How do I give a label to calculated fields, like if I used: rows = db().select(db.hvmt2.hub,db.*hvmt2.bytes_total.sum()*, groupby=db.hvmt2.hub, cacheable=True) I want to serialize rows as: Result=SQLTABLE(rows,headers={'hvmt2.hub':'HUB',*'hvmt2.bytes_total.sum()' *:'USAGE in MB'},truncate=60) But the summed column (what I referred to above as 'calculated') gets displayed as SUM(hvmt2.bytes_total) not 'USAGE in MB' as I desire. Thanks, mave On Thursday, January 21, 2010 5:36:17 AM UTC-8, Johann Spies wrote: I would like the table produced by SQLTABLE to have different column labels (e.g. Name for db.person.name). How do I do it? Also: I would like the output of SQLTABLE to provide links to individual records simliar to what appadmin does. I could not fully understand the code appadmin uses to achieve this. Can linkto be used in this case? From what I understand from te book linkto is a SQLFORM method and is not related to SQLTABLE. Regards Johann --