[web2py] Re: jQuery load no longer working
Missing a ) On Monday, 24 March 2014 21:49:51 UTC-5, horridohobbyist wrote: I have a strange issue. I had code that includes an external HTML file. It used to work. Lately, it suddenly no longer works. I've isolated the code and put it into my Welcome program. I am unable to figure out what's wrong. script $(function(){ $(#includedContent).load(/welcome/static/desc.html); }; /script div id='includedContent'Put included content here./div Since the Welcome application includes jQuery, this ought to work, right? And it did work in my development project. So what's wrong? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] custom auth table that work in earlier version but not in recent version
hi, i have custom auth table that work in earlier version but not in recent version. e.g. create new application and then add this code *models/db.py* db._common_fields.append(auth.signature) # work if commented # create table : bank db.define_table('bank', Field('bank'), format = '%(bank)s') # custom auth user table auth.settings.extra_fields['auth_user'] = [ Field('bank', 'reference bank', requires = IS_IN_DB(db, db.bank.id, '%(bank)s') ), ] # create all tables needed by auth if not custom tables auth.define_tables(username = True, signature = True) custom_auth_table custom_auth_table = db[auth.settings.table_user_name] auth.settings.table_user = custom_auth_table in earlier version, i run twice, first for create auth_user tables, i comment append commond field e.g. # db._common_fields.append(auth.signature) and then the second is to add common field on bank table i uncomment it. db._common_fields.append(auth.signature) those two steps is work in earlier version, but not in recent version. in recent version it return an error : Traceback (most recent call last): File C:\web2py\gluon\restricted.py, line 220, in restricted exec ccode in environment File C:/web2py/applications/test/models/db.py http://127.0.0.1:8000/admin/default/edit/test/models/db.py, line 88, in module format = '%(bank)s') File C:\web2py\gluon\dal.py, line 8223, in define_table table = self.lazy_define_table(tablename,*fields,**args) File C:\web2py\gluon\dal.py, line 8260, in lazy_define_table polymodel=polymodel) File C:\web2py\gluon\dal.py, line 925, in create_table raise KeyError('Cannot resolve reference %s in %s definition' % (referenced, table._tablename)) KeyError: 'Cannot resolve reference auth_user in bank definition' is it possible to have the same result like on earlier version? thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] auth.wiki Tagcloud show only the first 20 items
In the auth.wiki Tagcloud only the first 20 items displayed. Is there a possibility to change the value? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. attachment: Tagcloud.png
[web2py] Re: Ckeditor plugin - Update ckeditor
Actually, I just came back here to ask you to try to new release. I commented out that javascript, it seems to work now but you may need to reload your browser cache -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] G-event vs. Redis (?)
So, we came to the conclusion that combining the use of G-event as the server, and redis for caching, injects instabilities, with random hangings and crashing requests: I ruled-out the factor of using 0.13.x versions of G-event vs. the 1.x release - it happens in both cases. I ruled-out using redis for session-store or just for caching - it happens in any combination. When I use any form of redis-integration, while using any other server (i.e, rocket), everything works smoothly. When I use G-event of any version, while not using redis for anything, everything works smoothly. But when combining the two, and using G-event of any version while using redis for anything (session-store and/or caching), things go haywire... Our application is mainly cpu-bound, and we use a physical-machine (with no virtualization) with multiple-cores, so we want to take advantage of all the cores. And since python can-not do multiple things at once (due to the GIL), we need to run multiple python-processes. And since we rely heavily on caching, with keys that gets updated periodically by the use of the app, we really must have centralized-caching in some form. So for now, we are temporarily using python's simple-http server (we are running it via circus+chaussette, btw...), which makes things... well... noticeably less-snappy... My suspected culprit is the use of thread-locking in the web2py's redis-integration code. Am I correct? How can this be remedied? Can I safely remove the thread-locking code entirely from web2py's redis-modules (for single-thread servers like G-event)? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Ckeditor plugin - Update ckeditor
Well I've tried now on another computer with Chrome/IE/Firefox and the problem still the same, a lot of plugins are not displayed: [image: Immagine in linea 1] For example the text color picker. 2014-03-25 9:37 GMT+01:00 Tim Richardson t...@growthpath.com.au: Actually, I just came back here to ask you to try to new release. I commented out that javascript, it seems to work now but you may need to reload your browser cache -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/cbck_ammZYo/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. inline: image.png
Re: [web2py] Re: .json in url does not like contruções
done json.dumps({'name': var*.decode('utf8')*[:18], 'value': 1}) 2014-03-24 14:58 GMT+00:00 Iuri Guilherme dos Santos Martins aindatenhoco...@gmail.com: My guess is that the function is probably receiving this string: FOPIC - Constru\\u When it tries to convert the unicode character it returns the end of data error because the full unicode value is not present (00e7 for ç). So the problem is that you are truncating the string with the escaped unicode values (\\u00e7 instead of ç), which is causing the escaped character to be cut in the half. You should convert the string before truncate. Em 24-03-2014 11:36, António Ramos escreveu: This is my problem import json var=FOPIC - Construção e Investimentos, Lda. if i do json.dumps({'name': var, 'value': 1}) '{name: FOPIC - Constru\\u00e7\\u00e3o e Investimentos, Lda., value: 1}' its ok, but i need to truncate the string to the first 18 letters so i do json.dumps({'name': var[:18], 'value': 1}) Traceback (most recent call last): File interactive input, line 1, in module File C:\Python27\lib\json\__init__.py, line 231, in dumps return _default_encoder.encode(obj) File C:\Python27\lib\json\encoder.py, line 201, in encode chunks = self.iterencode(o, _one_shot=True) File C:\Python27\lib\json\encoder.py, line 264, in iterencode return _iterencode(o, 0) UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 17: unexpected end of data I need help ,as usual :P Thank you 2014-03-18 20:33 GMT+00:00 Michele Comitini michele.comit...@gmail.com: @Antonio, please create a simple example action that causes the error in your setup and post it here. something like # -*- coding: utf-8 -*- def myfunc(): return dict(mykey='contruções') 2014-03-18 15:57 GMT+01:00 António Ramos ramstei...@gmail.com: yes i have it in my controller.py file # -*- coding: utf-8 -*- 2014-03-18 14:48 GMT+00:00 Leonel Câmara leonelcam...@gmail.com: Olá António, Is your controller .py file saved in utf-8 (make sure the text editor is doing it, use the save with encoding option if you have it) and has this as the first line? # -*- coding: utf-8 -*- -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop
[web2py] Re: default value in Options Widget
Hi Stifan, When we set using zero='opt1' it adds 'opt1' as default text and when we look at the options in the form loaded it has ['opt1','opt1','opt2','opt3'] I am looking for more like setting 'opt1' as selected On Tuesday, 25 March 2014 13:06:13 UTC+11, 黄祥 wrote: had you already tried : requires = IS_IN_SET(['opt1', 'opt2', 'opt3'], zero = 'opt1') ref : http://web2py.com/books/default/chapter/29/07/forms-and-validators#Range--set-and-equality-validators best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Free web2py hosting for a free software web2py application
Dear Philip: I tried pythonanywhere and it could work, but I'd have to write code to mold into the limitations of that hosting and accept that a few things wouldn't work: do you still offer your spare hosting space? You'd need to install the following packages. |sudo apt-get install latex-xcolor texlive-latex-extra texlive-fonts-recommended python-numpy python-setuptools python-pysqlite2 sudo easy_install xlutils| Regards On 21/03/14 10:11, Philip Kilner wrote: Hi, I have spare capacity on a 4Gb London-based Ubuntu 12.04 Linode. The hosting management is via Virtualmin, so there are facilities for email etc. etc. As long as the server load is not going to be insane, I'd be happy to host free of charge - drop me a note off-list if you'd like to pursue that. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Problem with compute field
Found it. It was an open circuit between the keyboard and chair, as usual. The lambda computes the year of the swim meet, offset by 122 days (because their seasons begin on Sept 1 instead of Jan 1). However in my haste I typed date as the last method called, not year. Oops. Datetime.year returns the value of the year. But datetime.date returns a function, not a value, hence my compute field got NOTHING. My problem is now solved, and I have the pleasure of marking my own description as the best one! Hooray for me! -- Joe B. On Monday, March 24, 2014 1:20:59 PM UTC-7, Joe Barnhart wrote: I'm trying to auto-populate a field when a table entry is created. Of course, web2py has a feature, the compute= clause, just for this purpose! But... in my case at least, the feature is not working. OK -- full disclosure of the only weird thing going on in my design... I have pushed all table definitions into module files instead of loading them from the model directory. It saves a lot of time as I have large tables, and a bunch of them. So here is my table: @classmethod def createTable(cls,db): import datetime as dt db.define_table(meet, Field(id_club, reference club, label=Host club), Field(id_venue, reference venue, label=Venue, ondelete=SET NULL), Field(id_lsc, reference lsc, label=Swimming association, ondelete=SET NULL), Field(title, string, label=Additional Name,comment=ex: Spooktacular Halloween meet), Field(name, string,comment=ex: WA Zone 3 C/B/BB+), Field(sanction, string, label=Sanction Number), Field(info, text,label=Information,comment=To be shown on meet homepage), Field(start_date, date, label=Starting date,comment=First day of meet), ... blah, blah, blah... lots of fields here... Field(season, compute=lambda r: ((r['start_date'] or dt.datetime.now())+dt.timedelta(122)).date), current.auth.signature, format=%(name)s, migrate=current.settings.migrate) The table works perfectly except the compute field of season is never populated. I know for a fact the lambda is run, because when I had datetime imported into the wrong scope I got a walkback when this line was executed. But for some reason, the result of this calculation is never entered into the database when the row is created. Any ideas?? -- Joe B. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Free web2py hosting for a free software web2py application
Hi Pablo, On 25/03/14 11:14, Pablo Angulo wrote: I tried pythonanywhere and it could work, but I'd have to write code to mold into the limitations of that hosting and accept that a few things wouldn't work: do you still offer your spare hosting space? You'd need to install the following packages. |sudo apt-get install latex-xcolor texlive-latex-extra texlive-fonts-recommended python-numpy python-setuptools python-pysqlite2 sudo easy_install xlutils| Yes, no problem - will install the above and come back to you off-list. -- Regards, PhilK 'a bell is a cup...until it is struck' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: jQuery load no longer working
Sorry, bad transcription. The original code had the correct parentheses. Anyway, I found out what was wrong. I was trying to incorporate colorbox (a variation of jQuery's lightbox) and I included a different jquery.min.js. Apparently, this conflicted with web2py's jQuery. On Tuesday, 25 March 2014 02:34:13 UTC-4, Massimo Di Pierro wrote: Missing a ) On Monday, 24 March 2014 21:49:51 UTC-5, horridohobbyist wrote: I have a strange issue. I had code that includes an external HTML file. It used to work. Lately, it suddenly no longer works. I've isolated the code and put it into my Welcome program. I am unable to figure out what's wrong. script $(function(){ $(#includedContent).load(/welcome/static/desc.html); }; /script div id='includedContent'Put included content here./div Since the Welcome application includes jQuery, this ought to work, right? And it did work in my development project. So what's wrong? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: G-event vs. Redis (?)
Update : So, I did a little further testing - turns out that if I *don't use chaussette*, and instead call *anyserve.py* directly, then everything works smoothly with both g-event and redis: [watcher:gevent] working_dir = /srv/web2py cmd = python anyserver.py -s gevent However, I then loose all of the advantages of using circus: - Running multiple-processes - Adding/Removing processes from the web-ui - Real-time graphing of cpu/memory usage ... And without multiple processes, there is no use for redis anyways, and it can't scale to our needs... *(hmmm... Come to think of it, if there are no multiple processes accessing redis, maybe this is why it works...)* So it's back to square one... Enter *chaussette*: [watcher:gevent] working_dir = /srv/web2py cmd = /usr/bin/chaussette --fd $(circus.sockets.gevent)* --backend gevent* *gluon.main.wsgibase* numprocesses = 8 use_sockets = True [socket:gevent] host = localhost port = 8800 Now I'm binding to a ZeroMQ socket, and all circus-features work - but then I get the conditional-instability issues. A main difference I can see here is the way web2py is being launched - chaussette needs to be supplied with the WSGI application itself. What I did is give it the '*wsgibase*' function from *main.py* But perhaps that's the problem? Maybe something is missing when using gevent? If so, what? Because when using it without the gevent back-end, it works with redis no problem: [watcher:no_gevent] working_dir = /srv/web2py cmd = /usr/bin/chaussette --fd $(circus.sockets.no_gevent) *gluon.main.wsgibase* numprocesses = 8 use_sockets = True [socket:no_gevent] host = localhost port = 8800 This uses the default http-server in python... On Tuesday, March 25, 2014 11:43:40 AM UTC+2, Arnon Marcus wrote: So, we came to the conclusion that combining the use of G-event as the server, and redis for caching, injects instabilities, with random hangings and crashing requests: I ruled-out the factor of using 0.13.x versions of G-event vs. the 1.x release - it happens in both cases. I ruled-out using redis for session-store or just for caching - it happens in any combination. When I use any form of redis-integration, while using any other server (i.e, rocket), everything works smoothly. When I use G-event of any version, while not using redis for anything, everything works smoothly. But when combining the two, and using G-event of any version while using redis for anything (session-store and/or caching), things go haywire... Our application is mainly cpu-bound, and we use a physical-machine (with no virtualization) with multiple-cores, so we want to take advantage of all the cores. And since python can-not do multiple things at once (due to the GIL), we need to run multiple python-processes. And since we rely heavily on caching, with keys that gets updated periodically by the use of the app, we really must have centralized-caching in some form. So for now, we are temporarily using python's simple-http server (we are running it via circus+chaussette, btw...), which makes things... well... noticeably less-snappy... My suspected culprit is the use of thread-locking in the web2py's redis-integration code. Am I correct? How can this be remedied? Can I safely remove the thread-locking code entirely from web2py's redis-modules (for single-thread servers like G-event)? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: before_update callback and sheduler
Thank you!! thats why I was thinking that callback was not called, I check and the index is growing, but search functions allways return a null query. El 24/03/14 18:13, Niphlod escribió: Working fine here: steps to reproduce: - install whoosh - create a fresh app - overwrite fresh app with contents from your archive - go to /appname/default/form/1---argh!!! requesting me to follow the rabbit to see that if an arg isn't there the whole form crashes!!! - post a pdf - get /appname/default/form/1 with base_document.doc_text empty - run web2py.py -K appname - wait for the task to be executed steps to verify its working as expected: - get /appname/default/form/1 with base_document.doc_text full - confirm that private/index/ is created BTW: if you're expecting your print statements to appear somewhere you must turn on the debugging in the scheduler. Or, if you still want to debug by print (a perfectly fine method for simple things like this) just put a return 1 at the end of your task_get_pdf_text() function. In that way, a scheduler_run record will be created for each task execution and you'll be glad to see that your print statements are right there in the run_output column ! ^__^ -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com mailto:web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas Infomed: http://www.sld.cu/ -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Convert Mysql query with subquery to DAL.
Hi guys, Trying to convert this select t.id, t.gp_pro_id, t.gp_historicdate from course t where t.gp_historicdate = (select MAX(a.gp_historicdate) from course a where a.id = t.id) Any help is appreciated. Thanks! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: response.toolbar() does not show statistics for some tables
I found the reason. It was because of my own caching mechanism, which prevented executesql from executing. Thanks for help! W dniu poniedziałek, 24 marca 2014 18:45:59 UTC+1 użytkownik Massimo Di Pierro napisał: Please submit a bug report. It is possible executesql does not log it. On Monday, 24 March 2014 08:11:56 UTC-5, Maciej S wrote: Hello I try to use response.toolbar() to measure database queries. I've added it to the site, now it shows statistics only for tables created by web2py auth and tables connected to them, for example: SET standard_conforming_strings=on; 0.14ms SELECT company.id, company.number, company.name FROM company; 0.43ms SELECT count(*) FROM auth_group WHERE (auth_group.role = 'root'); 0.72ms SELECT count(*) FROM auth_group WHERE (auth_group.role = 'service'); 0.11ms SELECT count(*) FROM auth_group WHERE (auth_group.role = 'producer'); 0.10ms SELECT count(*) FROM auth_user WHERE (auth_user.email = 'te...@test.com'); 0.20ms SELECT auth_group.id, auth_group.role, auth_group.description FROM auth_group WHERE (auth_group.role = 'service'); 0.20ms SELECT auth_membership.id, auth_membership.user_id, auth_membership.group_id FROM auth_membership WHERE ((auth_membership.user_id = 1) AND (auth_membership.group_id = 2)); 0.31ms I have another tables like: db.define_table('controller', Field('uid', 'string', length=64, unique=True), Field('descr', 'string', length=256, notnull=True), Field('address_id', db.address, ondelete='SET NULL'), Field('service_access', 'boolean', notnull=True)) There is db.executesql query for that table and statistics are not shown. Do you known what is the reason for that? Maciej S -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] janrain and web2py
Any janrain users? Some users have reported that janrain no longer works with google login. I have experience the same problem. In December (version 2.9.x) we moved to the new Janrain API. I looked into this and the and the new API require a different and more complex configuration on the janrain page to use Google login. Specifically, they require a Google API. This is a show stopper for many. So the questions are: - do you use Janrain? - do you use Google with Janrain? - if so, does the OLD api still works (web2py 2.8.x)? - should we revert to the old API or have an option to use the old API? Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Ckeditor plugin - Update ckeditor
Hi, did you get the .w2p file from github? https://github.com/timrichardson/web2py_ckeditor4/releases/download/R-0.2/web2py.plugin.ckeditor.w2p I just a second ago updated web2py slices with the new version. On Tuesday, 25 March 2014 20:45:07 UTC+11, Gael Princivalle wrote: Well I've tried now on another computer with Chrome/IE/Firefox and the problem still the same, a lot of plugins are not displayed: [image: Immagine in linea 1] For example the text color picker. 2014-03-25 9:37 GMT+01:00 Tim Richardson t...@growthpath.com.aujavascript: : Actually, I just came back here to ask you to try to new release. I commented out that javascript, it seems to work now but you may need to reload your browser cache -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/cbck_ammZYo/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form
Bump...is is possible to use AJAX in a SQLFORM.grid Add form? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] janrain and web2py
In my case, I didn't used it. In case I needed to use oauth, I used https://github.com/r4bugento/web2social with some custom modifications, (because in the cases I needed oauth, I was asked to avoid third-party services for login). On 25 March 2014 18:30, Massimo Di Pierro massimo.dipie...@gmail.comwrote: Any janrain users? Some users have reported that janrain no longer works with google login. I have experience the same problem. In December (version 2.9.x) we moved to the new Janrain API. I looked into this and the and the new API require a different and more complex configuration on the janrain page to use Google login. Specifically, they require a Google API. This is a show stopper for many. So the questions are: - do you use Janrain? - do you use Google with Janrain? - if so, does the OLD api still works (web2py 2.8.x)? - should we revert to the old API or have an option to use the old API? Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: janrain and web2py
Janrain + Google seems to work fine on web2py 2.5.1. I am having a different problem with Janrain, though. In IE 10 and 11 on Windows 8.1, login doesn't work with any provider. When the pop-up window goes to a URL like this: https://appname.rpxnow.com/xdcomm#opener;0:%7B%22stat%22:%20%22ok%22,%20%22redirectUrl%22:%20%22http://appname.rpxnow.com/redirect?loc=14ac2af5c12ae2f9ab46c5b6f6b4aa6ef9b2af3b%22,%20%22origin%22:%20null,%20%22widget_type%22:%20%22auth%22,%20%22provider%22:%20null,%20%22welcome_info_name%22:%20%22Doe%20Doe%22%7D It generates the following JS error: SCRIPT5007: Unable to get property 'setTimeout' of undefined or nullreference File: xdcomm.js, Line: 1, Column: 583 Referring to this code: (function(c){var b=c.location.href,g=b.indexOf(#),l,i,e,h,m,a,d,k,j;if(g0 ){i=decodeURIComponent(b.substring(g+1))}else{throw new Error(RPX:receiver: Missing fragment.)}l=i.indexOf(;);if(l0){throw new Error(RPX:receiver: Missing flags separator.)}e=i.substring(0,l).split(,);d=i.substring(l+1); l=d.indexOf(:);if(l0){throw new Error(RPX:receiver: Missing func separator.)}a=d.substring(0,l);m=d.substring(l+1);k=function(f,o){for(var n =0;nf.length;n++){if(f[n]==o){return n}}return -1};if(k(e,top)=0){h=c. top}else{if(k(e,opener)=0){h=c.opener}else{h=c.parent}}h.setTimeout( function(){if(a==close){h.RPXNOW.Util.LightBox.close()}else{if(a== janrainSignin){h.janrainSignin()}else{if(a== JANRAIN.LOGIN_HELPER._redirect){h.JANRAIN.LOGIN_HELPER._redirect(m)}else{ if(!isNaN(a)){h.RPXNOW._xdCallbacks[a](m)return false},0)})(this); No problem on Windows 7 or if emulating IE 9 on Windows 8. Anthony On Tuesday, March 25, 2014 1:30:39 PM UTC-4, Massimo Di Pierro wrote: Any janrain users? Some users have reported that janrain no longer works with google login. I have experience the same problem. In December (version 2.9.x) we moved to the new Janrain API. I looked into this and the and the new API require a different and more complex configuration on the janrain page to use Google login. Specifically, they require a Google API. This is a show stopper for many. So the questions are: - do you use Janrain? - do you use Google with Janrain? - if so, does the OLD api still works (web2py 2.8.x)? - should we revert to the old API or have an option to use the old API? Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: janrain and web2py
I think we should switch to this: https://github.com/omab/python-social-auth 2014-03-25 21:37 GMT+01:00 Anthony abasta...@gmail.com: Janrain + Google seems to work fine on web2py 2.5.1. I am having a different problem with Janrain, though. In IE 10 and 11 on Windows 8.1, login doesn't work with any provider. When the pop-up window goes to a URL like this: https://appname.rpxnow.com/xdcomm#opener;0:%7B%22stat%22:%20%22ok%22,%20%22redirectUrl%22:%20%22http://appname.rpxnow.com/redirect?loc=14ac2af5c12ae2f9ab46c5b6f6b4aa6ef9b2af3b%22,%20%22origin%22:%20null,%20%22widget_type%22:%20%22auth%22,%20%22provider%22:%20null,%20%22welcome_info_name%22:%20%22Doe%20Doe%22%7D It generates the following JS error: SCRIPT5007: Unable to get property 'setTimeout' of undefined or null reference File: xdcomm.js, Line: 1, Column: 583 Referring to this code: (function(c){var b=c.location.href,g=b.indexOf(#),l,i,e,h,m,a,d,k,j;if(g0){i=decodeURIComponent(b.substring(g+1))}else{throw new Error(RPX:receiver: Missing fragment.)}l=i.indexOf(;);if(l0){throw new Error(RPX:receiver: Missing flags separator.)}e=i.substring(0,l).split(,);d=i.substring(l+1);l=d.indexOf(:);if(l0){throw new Error(RPX:receiver: Missing func separator.)}a=d.substring(0,l);m=d.substring(l+1);k=function(f,o){for(var n=0;nf.length;n++){if(f[n]==o){return n}}return -1};if(k(e,top)=0){h=c.top}else{if(k(e,opener)=0){h=c.opener}else{h=c.parent}}h.setTimeout(function(){if(a==close){h.RPXNOW.Util.LightBox.close()}else{if(a==janrainSignin){h.janrainSignin()}else{if(a==JANRAIN.LOGIN_HELPER._redirect){h.JANRAIN.LOGIN_HELPER._redirect(m)}else{if(!isNaN(a)){h.RPXNOW._xdCallbacks[a](m)return false},0)})(this); No problem on Windows 7 or if emulating IE 9 on Windows 8. Anthony On Tuesday, March 25, 2014 1:30:39 PM UTC-4, Massimo Di Pierro wrote: Any janrain users? Some users have reported that janrain no longer works with google login. I have experience the same problem. In December (version 2.9.x) we moved to the new Janrain API. I looked into this and the and the new API require a different and more complex configuration on the janrain page to use Google login. Specifically, they require a Google API. This is a show stopper for many. So the questions are: - do you use Janrain? - do you use Google with Janrain? - if so, does the OLD api still works (web2py 2.8.x)? - should we revert to the old API or have an option to use the old API? Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: janrain and web2py
Quint has done all the hard work for web2py: https://code.google.com/p/w2p-social-auth/ 2014-03-25 22:24 GMT+01:00 Michele Comitini michele.comit...@gmail.com: I think we should switch to this: https://github.com/omab/python-social-auth 2014-03-25 21:37 GMT+01:00 Anthony abasta...@gmail.com: Janrain + Google seems to work fine on web2py 2.5.1. I am having a different problem with Janrain, though. In IE 10 and 11 on Windows 8.1, login doesn't work with any provider. When the pop-up window goes to a URL like this: https://appname.rpxnow.com/xdcomm#opener;0:%7B%22stat%22:%20%22ok%22,%20%22redirectUrl%22:%20%22http://appname.rpxnow.com/redirect?loc=14ac2af5c12ae2f9ab46c5b6f6b4aa6ef9b2af3b%22,%20%22origin%22:%20null,%20%22widget_type%22:%20%22auth%22,%20%22provider%22:%20null,%20%22welcome_info_name%22:%20%22Doe%20Doe%22%7D It generates the following JS error: SCRIPT5007: Unable to get property 'setTimeout' of undefined or null reference File: xdcomm.js, Line: 1, Column: 583 Referring to this code: (function(c){var b=c.location.href,g=b.indexOf(#),l,i,e,h,m,a,d,k,j;if(g0){i=decodeURIComponent(b.substring(g+1))}else{throw new Error(RPX:receiver: Missing fragment.)}l=i.indexOf(;);if(l0){throw new Error(RPX:receiver: Missing flags separator.)}e=i.substring(0,l).split(,);d=i.substring(l+1);l=d.indexOf(:);if(l0){throw new Error(RPX:receiver: Missing func separator.)}a=d.substring(0,l);m=d.substring(l+1);k=function(f,o){for(var n=0;nf.length;n++){if(f[n]==o){return n}}return -1};if(k(e,top)=0){h=c.top}else{if(k(e,opener)=0){h=c.opener}else{h=c.parent}}h.setTimeout(function(){if(a==close){h.RPXNOW.Util.LightBox.close()}else{if(a==janrainSignin){h.janrainSignin()}else{if(a==JANRAIN.LOGIN_HELPER._redirect){h.JANRAIN.LOGIN_HELPER._redirect(m)}else{if(!isNaN(a)){h.RPXNOW._xdCallbacks[a](m)return false},0)})(this); No problem on Windows 7 or if emulating IE 9 on Windows 8. Anthony On Tuesday, March 25, 2014 1:30:39 PM UTC-4, Massimo Di Pierro wrote: Any janrain users? Some users have reported that janrain no longer works with google login. I have experience the same problem. In December (version 2.9.x) we moved to the new Janrain API. I looked into this and the and the new API require a different and more complex configuration on the janrain page to use Google login. Specifically, they require a Google API. This is a show stopper for many. So the questions are: - do you use Janrain? - do you use Google with Janrain? - if so, does the OLD api still works (web2py 2.8.x)? - should we revert to the old API or have an option to use the old API? Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Ckeditor plugin - Update ckeditor
https://lh4.googleusercontent.com/-lF6haCCyKqc/UzILWnjLqCI/ATg/5_xzfod7-7w/s1600/Screen+Shot+2014-03-26+at+10.02.51.png I think I am seeing all plugins ... that's my screen shot above (although I had to delete my browser cache before it would display properly). That's with the full version of ckeditor. As you've noticed, I removed the definition of the toolbar, letting ckeditor fall back to the defaults (which are presumably to show everything). I'll look into what you say about a new way of setting up the config. If you send my a github pull request for your preferred changes, I'll quickly review it. Otherwise I'll look at it, but I think the current release already does what you want. I don't think a browser difference could cause this, but perhaps I didn't upload the release properly. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Ckeditor plugin - Update ckeditor
try this https://github.com/timrichardson/web2py_ckeditor4/releases/download/R-0.3/web2py.plugin.ckeditor.w2p -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] boolean field type in a query.
Hi, i have a table with a boolean field: Field('f_test_is_a_clone', type='boolean', label=T('Test is a clone')), And this is the query, where I don't want to return cloned tests: my_tests_list = db((db.t_tests.created_by == auth.user.id) (not db.t_tests .f_test_is_a_clone)).select() but it returns empty list. What should i fix? thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: boolean field type in a query.
i think you can achieve it with true (1) or false (0) value e.g. my_tests_list = db((db.t_tests.created_by == auth.user.id) (db.t_tests.f_test_is_a_clone == 0) ).select() best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: janrain and web2py
To be honest, the price model of Janrain is way too prohibitive. If my site gets popular I'll be spending hundreds on the Janrain service -- it would become my most expensive service besides merchant services (a.k.a. credit card fees)! The free version is limited to 2500 users, which I will blow thru in about a month. Back when they actually showed their pricing, their solution was thousands/yr. (Now they cleverly hide it behind a contact our sales team form). On Tuesday, March 25, 2014 10:30:39 AM UTC-7, Massimo Di Pierro wrote: Any janrain users? Some users have reported that janrain no longer works with google login. I have experience the same problem. In December (version 2.9.x) we moved to the new Janrain API. I looked into this and the and the new API require a different and more complex configuration on the janrain page to use Google login. Specifically, they require a Google API. This is a show stopper for many. So the questions are: - do you use Janrain? - do you use Google with Janrain? - if so, does the OLD api still works (web2py 2.8.x)? - should we revert to the old API or have an option to use the old API? Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Tree stuctured layout problem
Web2py's tree structured layout seems to fall short in one area. I do not know if this is a bug, or if it is working as designed... I'm trying to bring order to the chaos that is my layout.html file. I wanted to break it into reasonable sections so I could manage each separately instead of always dealing with a big bag 'o stuff. To that end, I created a minimal layout.html file that uses include directives for header, footer, and body: !DOCTYPE html !-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -- !--[if lt IE 7]html class=ie ie6 ie-lte9 ie-lte8 ie-lte7 no-js lang={{=T.accepted_language or 'en'}} ![endif]-- !--[if IE 7]html class=ie ie7 ie-lte9 ie-lte8 ie-lte7 no-js lang={{=T.accepted_language or 'en'}} ![endif]-- !--[if IE 8]html class=ie ie8 ie-lte9 ie-lte8 no-js lang={{=T.accepted_language or 'en'}} ![endif]-- !--[if IE 9]html class=ie9 ie-lte9 no-js lang={{=T.accepted_language or 'en'}} ![endif]-- !--[if (gt IE 9)|!(IE)]!-- html class=no-js lang={{=T.accepted_language or 'en'}} !--![endif]-- {{include include_header.html}} body {{include include_navigation.html}} div id=main_container {{include include_dashboard.html}} div class=page-content div class=row-fluid div class=span12 !-- PAGE CONTENT BEGINS -- {{block center}} {{include}} {{end}} !-- PAGE CONTENT ENDS -- /div!-- /.span -- /div!-- /.row-fluid -- /div!-- /.page-content -- /div!-- /.main-content -- {{include include_devtools.html}} {{include include_footer.html}} Then, in the file include_header.html, for example, I would provide a place for blocks so the layout could be extended: head ... bunch of header related stuff goes here... {{block head}} {{end}} /head Unsurprisingly, this works fine -- but only to a point. When I declare a {{block head}}{{end}} block on my page, it gets substituted in the header as expected, but it ALSO appears on the page in the content area of the {{include}} directive on the top layout.html page. That is, it appears twice in my page! Apart from the wasted bandwidth (which with caching isn't a big deal) the main problem is that many things don't like to be loaded twice. My jQuery DataTables stuff, for instance, complains loudly about being initialized twice. So am I using the tools beyond their capability? Or is this just a minor bug that is easily corrected? -- Joe -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Session.forget(response) with apache2
Hi i am experiencing problem with session.forget(response). It is working perfectly with default web2py server on ajax calls. However it is not working with ubuntu+web2py+apache2+mod_wsgi. Can you please help me to resolve this. Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Virtual Fields and Smartgrid not working as expected
Hello, I am working with *2.9.5-stable+timestamp.2014.03.16.02.35.39* and getting Query Not Supported: 'str' object is not callable message I wonder if this issue is fixed or I am missing something. BTW, I am just starting my web2py process. King regards to all web2py community. On Thursday, September 19, 2013 3:49:35 AM UTC-5, hiro wrote: In the book I read: *Showing virtual fields in SQLFORM.grid and smartgrid* In recent versions of web2py, virtual fields are shown in grids like normal fields: either shown alongside all other fields by default, or by including them in the fields argument. However, virtual fields are not sortable. However, if i use the welcome app and define: db.define_table('entity', Field('entity_name', 'string'), Field('slogan', 'string'), Field.Virtual('slogan2', lambda row: row.entity.slogan+', it is really the best.') ) and then create a grid: def index(): my_grid = SQLFORM.grid(db.entity) return locals() Reading the book I expect this to work. However I get the error 'Query Not Supported: no such column: entity.slogan2' in the smartgrid. Massimo, is this related to to the same bug I asked about yesterday? (I have not yet updated my web2py to trunk, but did not find anything about this issue in the tracker.) One solution might be to change the Virtual Fiels to computed fields. A big hug to all web2py contributors! Edit: Using stable version of 2.6.4 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Can I query muliitple legacy databases?
Thanks. But if I do that doesn't that mean I can't use the results as objects? Isn't that the reason for the DAL and ORM (does it have an ORM)? How do I handle the values? I'd also have to insert data. For a select, you have, from the docs, as_dict=True. I'm new to Python. Can you show me how to iterate through that? I have: for key, value in db.iteritems(): print key, value What do I do about Insert and Updates? How do I send a value to the DAL for raw SQL queries? I found this from the documentation you sent me to, db.person.insert(name=Alex) But that's not raw SQL. I don't mind using SQL via a DAL, I'm just not sure how to go through the results in a python way. Then I found this, web2py can connect to legacy databases under some conditions. Don't know if this matters, if I can do transactions, many things that you would do with the DAL. For example, how could I do a transaction with raw SQL? Everything is based on the DAL creation of the database objects. On Thursday, March 20, 2014 12:37:24 PM UTC-4, learning wrote: I know what Python and web framework are, but need help understanding something about web2py. I have an old application that uses vbscript/asp. It hits multiple databases and brings it back to the user for a seamless experience. In other words, they don't have to go to ten pages to get information. All these databases are different engines. One might be Oracle, another MySQL, SQL Server, etc. How do I do that with Web2py? Do I have to get Web2py to generate models and am I forced to use an ORM? Is web2py suitable for a project like this? Can I use straight up SQL? These aggregate web pages are separate from the actual main page with the menu, etc. The portal page. Same website. Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Can I query muliitple legacy databases?
Please be sure to read the DAL section of the online web2py book it will explain a lot of this. When you use executesql you can choose how to see the results the as_dict means you can address fields/columns as dict keys or you can also use the fields colnames options to get objects just like normal DAL results. Example of as_dict #IN CONTROLLER def show_cart(): user_id = request.args[0] results = db.executesql('Select item, quantity, cost FROM shoping_cart WHERE user_id = ?', [user_id], as_dict=True) #now loop through the results, it's just a list of dicts. for row in results: On Tuesday, March 25, 2014 3:55:23 PM UTC-5, learning wrote: Thanks. But if I do that doesn't that mean I can't use the results as objects? Isn't that the reason for the DAL and ORM (does it have an ORM)? How do I handle the values? I'd also have to insert data. For a select, you have, from the docs, as_dict=True. I'm new to Python. Can you show me how to iterate through that? I have: for key, value in db.iteritems(): print key, value What do I do about Insert and Updates? How do I send a value to the DAL for raw SQL queries? I found this from the documentation you sent me to, db.person.insert(name=Alex) But that's not raw SQL. I don't mind using SQL via a DAL, I'm just not sure how to go through the results in a python way. Then I found this, web2py can connect to legacy databases under some conditions. Don't know if this matters, if I can do transactions, many things that you would do with the DAL. For example, how could I do a transaction with raw SQL? Everything is based on the DAL creation of the database objects. On Thursday, March 20, 2014 12:37:24 PM UTC-4, learning wrote: I know what Python and web framework are, but need help understanding something about web2py. I have an old application that uses vbscript/asp. It hits multiple databases and brings it back to the user for a seamless experience. In other words, they don't have to go to ten pages to get information. All these databases are different engines. One might be Oracle, another MySQL, SQL Server, etc. How do I do that with Web2py? Do I have to get Web2py to generate models and am I forced to use an ORM? Is web2py suitable for a project like this? Can I use straight up SQL? These aggregate web pages are separate from the actual main page with the menu, etc. The portal page. Same website. Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Remove query db field
Hi all. As mostly may know, when doing a select query the result will show a db field title for each column. How do i remove or change this db field title for some nice header as use with smartgrid.? Thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: boolean field type in a query.
I'm a little bit rusty on booleans, but I think from memory: a) exactly what value is stored in the field depends on the backend, but the DAL always works with True and False but b) you can also end up with NULL if you're not careful, and NULL is not necessarily the same as False. so make sure you set a sensible default value (either True or False) On Wednesday, 26 March 2014 11:08:40 UTC+11, Avi A wrote: Hi, i have a table with a boolean field: Field('f_test_is_a_clone', type='boolean', label=T('Test is a clone')), And this is the query, where I don't want to return cloned tests: my_tests_list = db((db.t_tests.created_by == auth.user.id) (not db. t_tests.f_test_is_a_clone)).select() but it returns empty list. What should i fix? thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Session.forget(response) with apache2
can you explain what you mean by it is not working? On Tuesday, 25 March 2014 16:11:59 UTC-5, Sushma K wrote: Hi i am experiencing problem with session.forget(response). It is working perfectly with default web2py server on ajax calls. However it is not working with ubuntu+web2py+apache2+mod_wsgi. Can you please help me to resolve this. Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Tree stuctured layout problem
I cannot reproduce it. There is a {{block head}}{{end}} just before /head in 2.9.5. Could you email me a minimalist app to reproduce it? On Tuesday, 25 March 2014 21:49:35 UTC-5, Joe Barnhart wrote: Web2py's tree structured layout seems to fall short in one area. I do not know if this is a bug, or if it is working as designed... I'm trying to bring order to the chaos that is my layout.html file. I wanted to break it into reasonable sections so I could manage each separately instead of always dealing with a big bag 'o stuff. To that end, I created a minimal layout.html file that uses include directives for header, footer, and body: !DOCTYPE html !-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/-- !--[if lt IE 7]html class=ie ie6 ie-lte9 ie-lte8 ie-lte7 no-js lang={{=T.accepted_language or 'en'}} ![endif]-- !--[if IE 7]html class=ie ie7 ie-lte9 ie-lte8 ie-lte7 no-js lang={{=T.accepted_language or 'en'}} ![endif]-- !--[if IE 8]html class=ie ie8 ie-lte9 ie-lte8 no-js lang={{=T.accepted_language or 'en'}} ![endif]-- !--[if IE 9]html class=ie9 ie-lte9 no-js lang={{=T.accepted_language or 'en'}} ![endif]-- !--[if (gt IE 9)|!(IE)]!-- html class=no-js lang={{=T.accepted_language or 'en'}} !--![endif]-- {{include include_header.html}} body {{include include_navigation.html}} div id=main_container {{include include_dashboard.html}} div class=page-content div class=row-fluid div class=span12 !-- PAGE CONTENT BEGINS -- {{block center}} {{include}} {{end}} !-- PAGE CONTENT ENDS -- /div!-- /.span -- /div!-- /.row-fluid -- /div!-- /.page-content -- /div!-- /.main-content -- {{include include_devtools.html}} {{include include_footer.html}} Then, in the file include_header.html, for example, I would provide a place for blocks so the layout could be extended: head ... bunch of header related stuff goes here... {{block head}} {{end}} /head Unsurprisingly, this works fine -- but only to a point. When I declare a {{block head}}{{end}} block on my page, it gets substituted in the header as expected, but it ALSO appears on the page in the content area of the {{include}} directive on the top layout.html page. That is, it appears twice in my page! Apart from the wasted bandwidth (which with caching isn't a big deal) the main problem is that many things don't like to be loaded twice. My jQuery DataTables stuff, for instance, complains loudly about being initialized twice. So am I using the tools beyond their capability? Or is this just a minor bug that is easily corrected? -- Joe -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.