[web2py] Re: The book updates and status
IMHO, as I have said previously, it would be nice if the markmin to PDF converter produced comparable layouts/fonts to the online version of the book... The printed book, up to now, misses a lot of the pleasant and appealing layout of the online version. --
[web2py] vert.x
I just came on http://vertx.io/, it supports python (jython) what do you think? http://vertx.io and here also an article http://blog.andrewvc.com/vertx-node-on-ropes --
Re: [web2py] Possible bug in JSONRPC in v2.3.2
both of you, jump on the bandwagon here . https://groups.google.com/d/topic/web2py/5kCYP-wiELo/discussion On Saturday, December 22, 2012 7:04:18 AM UTC+1, rochacbruno wrote: On Sat, Dec 22, 2012 at 3:57 AM, Mike D mike@gmail.com javascript:wrote: s = methods[method](**params) I guess it should be s = methods[method](*args, **params) to be more flexible --
[web2py] Re: 2.2.1 left joins broken?
uhm the thing is, if you have record versioning, all active records should be marked with True. There's no point in record versioning if active records can be False or True *or None*. They can be either True or False to correctly identify the single active record on those tables. am I missing something ? On Saturday, December 22, 2012 12:52:59 AM UTC+1, Massimo Di Pierro wrote: It is correct in the sense it is what I intended it to be. You are proposing a change of behavior. I see where you are coming from. Please open a ticket about this. I would like to have some more opinions about this. Should None in is_active be treated as True? On Friday, 21 December 2012 14:02:25 UTC-6, Cliff Kachinske wrote: SQL is incorrect. is: AND supplier_contacts.is_active = 'T' should be AND (supplier_contacts.is_active = 'T' OR supplier_contacts.is_active IS NULL) On Friday, December 21, 2012 1:05:16 PM UTC-5, Massimo Di Pierro wrote: It looks to be the generated SQL is correct. It is possible you enabled record versioning and that added the common_filter is_active==True. Yet perhaps you have records with is_active=None and therefore they showed up before and not now. On Friday, 21 December 2012 10:50:13 UTC-6, Cliff Kachinske wrote: Salient details from two tables: db.define_table( 'suppliers', Field('name', length=256, required=True, notnull=True), db.define_table( 'supplier_contacts', Field('supplier_id', db.suppliers), Field('first_name', length=32, required=True, notnull=True), The code below worked in 1.99.7. If the supplier had two contacts, it would return two rows as expected, both with the same supplier data but each with individual contact data. In 2.2.1 it returns no rows. def get_approved_suppliers(product_id): return db( (db.product_suppliers.product_id==product_id) (db.product_suppliers.supplier_id==db.suppliers.id) ).select( db.suppliers.id, db.suppliers.name, # more supplier details omitted for brevity, db.supplier_contacts.id, db.supplier_contacts.first_name, # contact details omitted for brevity. left = db.supplier_contacts.on( db.supplier_contacts.supplier_id==db.suppliers. id ) ) This is the query as shown by db._lastsql. (Broken into chunks for readability) SELECT suppliers.id, suppliers.name, suppliers.address, suppliers. address_2, suppliers.city, suppliers.state, suppliers.zip, suppliers. land_line, suppliers.fax, suppliers.email, suppliers.website,supplier_contacts .id, supplier_contacts.first_name, supplier_contacts.middle_name,supplier_contacts .last_name, supplier_contacts.generation, supplier_contacts.email,supplier_contacts .mobile, supplier_contacts.land_line, supplier_contacts.fax FROM product_suppliers, suppliers LEFT JOIN supplier_contacts ON (supplier_contacts.supplier_id =suppliers .id) WHERE (product_suppliers.product_id = 340) AND (product_suppliers.supplier_id = suppliers.id)) AND (product_suppliers.is_active = 'T')) AND ( suppliers.is_active = 'T')) AND (supplier_contacts.is_active = 'T')); --
[web2py] Re: smartgrid button placement 'left' 'right', 'both'
you'd have to import the new gluon/sqlhtml.py code. https://github.com/web2py/web2py/commit/0ee551de71853f8e65ba7520d5d83a7ef318da39 On Friday, December 21, 2012 6:30:04 PM UTC+1, joe smith wrote: I am trying to set the button placement of the View, Edit, Delete buttons in the smartgrid table to be 'left'. I am using: button_placement = 'left' in my controller when I set a smartgrid. It works in web2py 2.3.2 on my local machine, but won't work in 2.2.1 on our server. Is that setting not compatible with 2.2.1? If not, how can I do it in that version? --
[web2py] probing into examples application
Just noticed from gogle webmaster tools that someone was probing into links bellow and got 500 server response for each. Is there anything that could potentially be dangerous from a security prospective, since examples get deployed with every installation of web2py? (I deleted it now in production, but didn't think of it as a threat before) examples/global/vars examples/global/vars/H1/__class__ examples/global/vars/XML/__class__ examples/global/vars/INPUT/__class__ examples/global/vars/IS_NOT_EMPTY/__class__ examples/global/vars/IS_IN_SET/__class__ examples/global/vars/IS_INT_IN_RANGE/__class__ examples/global/vars/DIV/__class__ examples/global/vars/HTML/__class__ examples/global/vars/A/__class__ examples/global/vars/SELECT/__class__ examples/simple_examples/raiseexception examples/global/vars/BODY/__class__ examples/global/vars/IS_EMAIL/__class__ examples/global/vars/TEXTAREA/__class__ examples/global/vars/SQLTABLE/__class__ examples/global/vars/SQLFORM/__class__ examples/global/vars/IS_NOT_IN_DB/__class__ examples/global/vars/IS_IN_DB/__class__ examples/global/vars/FORM/__class__ examples/global/vars/Field/__class__ examples/global/vars/BEAUTIFY/__class__ examples/global/vars/HTTP/__class__ examples/global/vars/MARKMIN/__class__ examples/global/vars/TABLE/__class__ examples/simple_examples/rss_aggregator examples/global/vars/TR/__class__ --
[web2py] Re: probing into examples application
well, the source code is available since the example app is released with web2py... I don't think any security is breached if someone is accessing those pages. PS: Of course in production you should deploy only your app and remove examples. Welcome and admin are also going to be removed if you don't need to develop something on the server. PS2: Expect a lot of scanning also at urls like /phpmyadmin/, /wp-admin/ etc trolls and auto-bots are never going to stop probing urls. On Saturday, December 22, 2012 2:46:59 PM UTC+1, Adi wrote: Just noticed from gogle webmaster tools that someone was probing into links bellow and got 500 server response for each. Is there anything that could potentially be dangerous from a security prospective, since examples get deployed with every installation of web2py? (I deleted it now in production, but didn't think of it as a threat before) examples/global/vars examples/global/vars/H1/__class__ examples/global/vars/XML/__class__ examples/global/vars/INPUT/__class__ examples/global/vars/IS_NOT_EMPTY/__class__ examples/global/vars/IS_IN_SET/__class__ examples/global/vars/IS_INT_IN_RANGE/__class__ examples/global/vars/DIV/__class__ examples/global/vars/HTML/__class__ examples/global/vars/A/__class__ examples/global/vars/SELECT/__class__ examples/simple_examples/raiseexception examples/global/vars/BODY/__class__ examples/global/vars/IS_EMAIL/__class__ examples/global/vars/TEXTAREA/__class__ examples/global/vars/SQLTABLE/__class__ examples/global/vars/SQLFORM/__class__ examples/global/vars/IS_NOT_IN_DB/__class__ examples/global/vars/IS_IN_DB/__class__ examples/global/vars/FORM/__class__ examples/global/vars/Field/__class__ examples/global/vars/BEAUTIFY/__class__ examples/global/vars/HTTP/__class__ examples/global/vars/MARKMIN/__class__ examples/global/vars/TABLE/__class__ examples/simple_examples/rss_aggregator examples/global/vars/TR/__class__ --
[web2py] how to use session in cookie?
I tried using session.connect(cookie_key='key', compression_level=9) instead of session.connect(request, response, db=db), and got the error as bellow, plus some inconsistent unexpected behavior. When I rolled back to db sessions all works fine as expected. It's an e-commerce app, usingsessions bit heavier. Are there known limitations for using cookie sessions? Also, if I can use memcache with mysql, how do I define a client? Tried mc = memcache.Client(['127.0.0.1:11211'], debug=0), with no success... Thanks, Adnan web2py: Version 2.3.2 (2012-12-17 15:03:30) stable OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/2.2.3 (Red Hat) Server at w2p.demo.com Port 80 --
[web2py] Re: The book updates and status
The book is converted automatically from the online version. markmin-latex-pdf. Can you say specifically what should be changed in the pdf/printed version? On Saturday, 22 December 2012 04:15:26 UTC-6, Kostas M wrote: IMHO, as I have said previously, it would be nice if the markmin to PDF converter produced comparable layouts/fonts to the online version of the book... The printed book, up to now, misses a lot of the pleasant and appealing layout of the online version. --
Re: [web2py] Possible bug in JSONRPC in v2.3.2
Turns out we do not have a choice. params is a variable specified by jsonrpc. It can be an array or an object. The change in trunk was wrong as we need to check whether it is an array or an object (serialized as dict). and act accordingly. It should now be fixed in trunk. Massimo On Saturday, 22 December 2012 07:03:36 UTC-6, Niphlod wrote: both of you, jump on the bandwagon here . https://groups.google.com/d/topic/web2py/5kCYP-wiELo/discussion On Saturday, December 22, 2012 7:04:18 AM UTC+1, rochacbruno wrote: On Sat, Dec 22, 2012 at 3:57 AM, Mike D mike@gmail.com wrote: s = methods[method](**params) I guess it should be s = methods[method](*args, **params) to be more flexible --
[web2py] Re: 2.2.1 left joins broken?
I think we agree with each other. The problem is that somebody may add auth.signature later and therefore precent records will have is_active=None. The user will have to manually set is_active from None to True. On Saturday, 22 December 2012 07:08:58 UTC-6, Niphlod wrote: uhm the thing is, if you have record versioning, all active records should be marked with True. There's no point in record versioning if active records can be False or True *or None*. They can be either True or False to correctly identify the single active record on those tables. am I missing something ? On Saturday, December 22, 2012 12:52:59 AM UTC+1, Massimo Di Pierro wrote: It is correct in the sense it is what I intended it to be. You are proposing a change of behavior. I see where you are coming from. Please open a ticket about this. I would like to have some more opinions about this. Should None in is_active be treated as True? On Friday, 21 December 2012 14:02:25 UTC-6, Cliff Kachinske wrote: SQL is incorrect. is: AND supplier_contacts.is_active = 'T' should be AND (supplier_contacts.is_active = 'T' OR supplier_contacts.is_active IS NULL) On Friday, December 21, 2012 1:05:16 PM UTC-5, Massimo Di Pierro wrote: It looks to be the generated SQL is correct. It is possible you enabled record versioning and that added the common_filter is_active==True. Yet perhaps you have records with is_active=None and therefore they showed up before and not now. On Friday, 21 December 2012 10:50:13 UTC-6, Cliff Kachinske wrote: Salient details from two tables: db.define_table( 'suppliers', Field('name', length=256, required=True, notnull=True), db.define_table( 'supplier_contacts', Field('supplier_id', db.suppliers), Field('first_name', length=32, required=True, notnull=True), The code below worked in 1.99.7. If the supplier had two contacts, it would return two rows as expected, both with the same supplier data but each with individual contact data. In 2.2.1 it returns no rows. def get_approved_suppliers(product_id): return db( (db.product_suppliers.product_id==product_id) (db.product_suppliers.supplier_id==db.suppliers.id) ).select( db.suppliers.id, db.suppliers.name, # more supplier details omitted for brevity, db.supplier_contacts.id, db.supplier_contacts.first_name, # contact details omitted for brevity. left = db.supplier_contacts.on( db.supplier_contacts.supplier_id==db.suppliers .id ) ) This is the query as shown by db._lastsql. (Broken into chunks for readability) SELECT suppliers.id, suppliers.name, suppliers.address, suppliers. address_2, suppliers.city, suppliers.state, suppliers.zip, suppliers. land_line, suppliers.fax, suppliers.email, suppliers.website,supplier_contacts .id, supplier_contacts.first_name, supplier_contacts.middle_name,supplier_contacts .last_name, supplier_contacts.generation, supplier_contacts.email,supplier_contacts .mobile, supplier_contacts.land_line, supplier_contacts.fax FROM product_suppliers, suppliers LEFT JOIN supplier_contacts ON (supplier_contacts.supplier_id =suppliers .id) WHERE (product_suppliers.product_id = 340) AND (product_suppliers.supplier_id = suppliers.id)) AND (product_suppliers.is_active = 'T')) AND ( suppliers.is_active = 'T')) AND (supplier_contacts.is_active = 'T')); --
[web2py] Re: how to use session in cookie?
Can you please look for the error in the apache logs? There is a limitation in the cookie size wich may break for large sessions. On Saturday, 22 December 2012 08:49:04 UTC-6, Adi wrote: I tried using session.connect(cookie_key='key', compression_level=9) instead of session.connect(request, response, db=db), and got the error as bellow, plus some inconsistent unexpected behavior. When I rolled back to db sessions all works fine as expected. It's an e-commerce app, usingsessions bit heavier. Are there known limitations for using cookie sessions? Also, if I can use memcache with mysql, how do I define a client? Tried mc = memcache.Client(['127.0.0.1:11211'], debug=0), with no success... Thanks, Adnan web2py: Version 2.3.2 (2012-12-17 15:03:30) stable OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/2.2.3 (Red Hat) Server at w2p.demo.com Port 80 --
Re: [web2py] Interesting - Brython (python to javascript)
How do you debug this? Is here a source-map generation mechanism to allow debugging python code in the browser's debugger? Can the transpiler run server-side? On Fri, Dec 21, 2012 at 1:20 PM, Francois Dion francois.d...@gmail.comwrote: If you have had issues with these, you should report the bugs, because It does support string interpolation, modules and scope. List comprehension and the ternary operator have been added earlier this week. Classes is the main thing left. I started using brython in a limited deployment. I think the python module import loading thru ajax works well in my scenario, up to now, but I'll let this run for a little while more. François -- www.pyptug.org - raspberry-python.blogspot.com On Monday, December 17, 2012 2:08:41 AM UTC-5, viniciusban wrote: Brypthon doesn't support string interpolation, too. :-( On Sun, Dec 16, 2012 at 6:40 PM, Arnon Marcus a.m.m...@gmail.com wrote: From what I saw, it does not support many fundamental features of python, like class-inheritance (class, classMethod) modules (__import__, from, as), scope (globals, nonlocal) and parsing (exec, eval). I think these are trivial for python developement, and should have some kind of design-pattern transpiling specification that it follows. I think CoffeeScript actually has many of these already implemented, as is quite pythonic already in much of it's syntax - and is much closer to JavaScript in the first place and already has tons of tools for denugging, client/server-side automatic-transpiling, bundled up in minification/compression algorythms, etc... It's a cool idea, and pyjammas has existed for a long time now, but is anyone seriously thinking about using that in production? I think as long as browsers don't have some kind of cross-language VMs, or at least a PVM built-in/plugin, than with all the excitement, it will remain useless. I mean, how do you debug this? -- -- --
[web2py] Re: 2.2.1 left joins broken?
agreeing too. Someone applying versioning AFTER must know that he must set all current records to True (maybe a note marked important on the relevant section on the book may be appropriate). Better a one-time operation than large where conditions appearing everywhere and killing performances. On Saturday, December 22, 2012 4:00:42 PM UTC+1, Massimo Di Pierro wrote: I think we agree with each other. The problem is that somebody may add auth.signature later and therefore precent records will have is_active=None. The user will have to manually set is_active from None to True. On Saturday, 22 December 2012 07:08:58 UTC-6, Niphlod wrote: uhm the thing is, if you have record versioning, all active records should be marked with True. There's no point in record versioning if active records can be False or True *or None*. They can be either True or False to correctly identify the single active record on those tables. am I missing something ? On Saturday, December 22, 2012 12:52:59 AM UTC+1, Massimo Di Pierro wrote: It is correct in the sense it is what I intended it to be. You are proposing a change of behavior. I see where you are coming from. Please open a ticket about this. I would like to have some more opinions about this. Should None in is_active be treated as True? On Friday, 21 December 2012 14:02:25 UTC-6, Cliff Kachinske wrote: SQL is incorrect. is: AND supplier_contacts.is_active = 'T' should be AND (supplier_contacts.is_active = 'T' OR supplier_contacts.is_active IS NULL) On Friday, December 21, 2012 1:05:16 PM UTC-5, Massimo Di Pierro wrote: It looks to be the generated SQL is correct. It is possible you enabled record versioning and that added the common_filter is_active==True. Yet perhaps you have records with is_active=None and therefore they showed up before and not now. On Friday, 21 December 2012 10:50:13 UTC-6, Cliff Kachinske wrote: Salient details from two tables: db.define_table( 'suppliers', Field('name', length=256, required=True, notnull=True), db.define_table( 'supplier_contacts', Field('supplier_id', db.suppliers), Field('first_name', length=32, required=True, notnull=True), The code below worked in 1.99.7. If the supplier had two contacts, it would return two rows as expected, both with the same supplier data but each with individual contact data. In 2.2.1 it returns no rows. def get_approved_suppliers(product_id): return db( (db.product_suppliers.product_id==product_id) (db.product_suppliers.supplier_id==db.suppliers.id) ).select( db.suppliers.id, db.suppliers.name, # more supplier details omitted for brevity, db.supplier_contacts.id, db.supplier_contacts.first_name, # contact details omitted for brevity. left = db.supplier_contacts.on( db.supplier_contacts.supplier_id==db. suppliers.id ) ) This is the query as shown by db._lastsql. (Broken into chunks for readability) SELECT suppliers.id, suppliers.name, suppliers.address, suppliers. address_2, suppliers.city, suppliers.state, suppliers.zip, suppliers. land_line, suppliers.fax, suppliers.email, suppliers.website,supplier_contacts .id, supplier_contacts.first_name, supplier_contacts.middle_name,supplier_contacts .last_name, supplier_contacts.generation, supplier_contacts.email,supplier_contacts .mobile, supplier_contacts.land_line, supplier_contacts.fax FROM product_suppliers, suppliers LEFT JOIN supplier_contacts ON (supplier_contacts.supplier_id =suppliers .id) WHERE (product_suppliers.product_id = 340) AND (product_suppliers .supplier_id = suppliers.id)) AND (product_suppliers.is_active = 'T' )) AND (suppliers.is_active = 'T')) AND (supplier_contacts.is_active = 'T')); --
[web2py] Re: how to use session in cookie?
Size could definitely be my problem... Bellow is the bottom part of the Apache error log: [Sat Dec 22 04:22:50 2012] [error] k,len 0 3 [Sat Dec 22 04:22:50 2012] [error] k,len 1 3 [Sat Dec 22 04:22:50 2012] [error] k,len 2 3 [Sat Dec 22 04:22:54 2012] [error] k,len 0 3 [Sat Dec 22 04:22:54 2012] [error] k,len 1 3 [Sat Dec 22 04:22:54 2012] [error] k,len 2 3 [Sat Dec 22 07:39:04 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T12:39:04Z'], 'TOKEN': ['EC-25J033232E8733719'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['2fcce583dd4e2']} [Sat Dec 22 08:18:29 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T13:18:29Z'], 'TOKEN': ['EC-3RG928080L406004A'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['bea4a71f87268']} [Sat Dec 22 08:25:17 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T13:25:17Z'], 'TOKEN': ['EC-7GY27898JG123493D'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['3941637927a28']} [Sat Dec 22 08:26:09 2012] [error] k,len 0 1 [Sat Dec 22 08:26:23 2012] [error] k,len 0 1 I would like to steer away from db sessions, since we had a large problem when doing PCI compliance test with nCircle... They could literally bring our websites down due to opening million parallel connections, which should be fine... The error was on our side :) Memcache resolved that problem, but that was with php. Now, I would like to use the similar approach with web2py, and then we can test a pci scan :) On Saturday, December 22, 2012 10:02:28 AM UTC-5, Massimo Di Pierro wrote: Can you please look for the error in the apache logs? There is a limitation in the cookie size wich may break for large sessions. On Saturday, 22 December 2012 08:49:04 UTC-6, Adi wrote: I tried using session.connect(cookie_key='key', compression_level=9) instead of session.connect(request, response, db=db), and got the error as bellow, plus some inconsistent unexpected behavior. When I rolled back to db sessions all works fine as expected. It's an e-commerce app, usingsessions bit heavier. Are there known limitations for using cookie sessions? Also, if I can use memcache with mysql, how do I define a client? Tried mc = memcache.Client(['127.0.0.1:11211'], debug=0), with no success... Thanks, Adnan web2py: Version 2.3.2 (2012-12-17 15:03:30) stable OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/2.2.3 (Red Hat) Server at w2p.demo.com Port 80 --
[web2py] Re: probing into examples application
Thanks Simone. Just wanted to mention it, in case there is potentially something to double-check, or worry, but all seems to be good :) On Saturday, December 22, 2012 9:14:23 AM UTC-5, Niphlod wrote: well, the source code is available since the example app is released with web2py... I don't think any security is breached if someone is accessing those pages. PS: Of course in production you should deploy only your app and remove examples. Welcome and admin are also going to be removed if you don't need to develop something on the server. PS2: Expect a lot of scanning also at urls like /phpmyadmin/, /wp-admin/ etc trolls and auto-bots are never going to stop probing urls. On Saturday, December 22, 2012 2:46:59 PM UTC+1, Adi wrote: Just noticed from gogle webmaster tools that someone was probing into links bellow and got 500 server response for each. Is there anything that could potentially be dangerous from a security prospective, since examples get deployed with every installation of web2py? (I deleted it now in production, but didn't think of it as a threat before) examples/global/vars examples/global/vars/H1/__class__ examples/global/vars/XML/__class__ examples/global/vars/INPUT/__class__ examples/global/vars/IS_NOT_EMPTY/__class__ examples/global/vars/IS_IN_SET/__class__ examples/global/vars/IS_INT_IN_RANGE/__class__ examples/global/vars/DIV/__class__ examples/global/vars/HTML/__class__ examples/global/vars/A/__class__ examples/global/vars/SELECT/__class__ examples/simple_examples/raiseexception examples/global/vars/BODY/__class__ examples/global/vars/IS_EMAIL/__class__ examples/global/vars/TEXTAREA/__class__ examples/global/vars/SQLTABLE/__class__ examples/global/vars/SQLFORM/__class__ examples/global/vars/IS_NOT_IN_DB/__class__ examples/global/vars/IS_IN_DB/__class__ examples/global/vars/FORM/__class__ examples/global/vars/Field/__class__ examples/global/vars/BEAUTIFY/__class__ examples/global/vars/HTTP/__class__ examples/global/vars/MARKMIN/__class__ examples/global/vars/TABLE/__class__ examples/simple_examples/rss_aggregator examples/global/vars/TR/__class__ --
[web2py] Re: how to use session in cookie?
Sorry Massimo, Seems I was looking into wrong error_log... This one is related to web2py... JUst run it again: [Sat Dec 22 11:10:53 2012] [error] [client 24.150.57.81] (13)Permission denied: access to /mobipp_us/static/plugin_wiki/rating/jquery.rating.js denied, referer: http://w.replacedserver.com/mobipp_us/category/11 [Sat Dec 22 11:10:57 2012] [error] [client 24.150.57.81] malformed header from script. Bad header=QRZl7DmMFohP98mTnbyI4cEEvQcxWS: wsgihandler.py, referer: http://w.replacedserver.com/mobipp_us/category/11 On Saturday, December 22, 2012 10:32:34 AM UTC-5, Adi wrote: Size could definitely be my problem... Bellow is the bottom part of the Apache error log: [Sat Dec 22 04:22:50 2012] [error] k,len 0 3 [Sat Dec 22 04:22:50 2012] [error] k,len 1 3 [Sat Dec 22 04:22:50 2012] [error] k,len 2 3 [Sat Dec 22 04:22:54 2012] [error] k,len 0 3 [Sat Dec 22 04:22:54 2012] [error] k,len 1 3 [Sat Dec 22 04:22:54 2012] [error] k,len 2 3 [Sat Dec 22 07:39:04 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T12:39:04Z'], 'TOKEN': ['EC-25J033232E8733719'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['2fcce583dd4e2']} [Sat Dec 22 08:18:29 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T13:18:29Z'], 'TOKEN': ['EC-3RG928080L406004A'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['bea4a71f87268']} [Sat Dec 22 08:25:17 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T13:25:17Z'], 'TOKEN': ['EC-7GY27898JG123493D'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['3941637927a28']} [Sat Dec 22 08:26:09 2012] [error] k,len 0 1 [Sat Dec 22 08:26:23 2012] [error] k,len 0 1 I would like to steer away from db sessions, since we had a large problem when doing PCI compliance test with nCircle... They could literally bring our websites down due to opening million parallel connections, which should be fine... The error was on our side :) Memcache resolved that problem, but that was with php. Now, I would like to use the similar approach with web2py, and then we can test a pci scan :) On Saturday, December 22, 2012 10:02:28 AM UTC-5, Massimo Di Pierro wrote: Can you please look for the error in the apache logs? There is a limitation in the cookie size wich may break for large sessions. On Saturday, 22 December 2012 08:49:04 UTC-6, Adi wrote: I tried using session.connect(cookie_key='key', compression_level=9) instead of session.connect(request, response, db=db), and got the error as bellow, plus some inconsistent unexpected behavior. When I rolled back to db sessions all works fine as expected. It's an e-commerce app, usingsessions bit heavier. Are there known limitations for using cookie sessions? Also, if I can use memcache with mysql, how do I define a client? Tried mc = memcache.Client(['127.0.0.1:11211'], debug=0), with no success... Thanks, Adnan web2py: Version 2.3.2 (2012-12-17 15:03:30) stable OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/2.2.3 (Red Hat) Server at w2p.demo.com Port 80 --
[web2py] Re: 2.2.1 left joins broken?
I changed it so that auth.signature.is_active defaults to notnull=True. This makes sure what when added in a migration, it sets the default value for existing records. Hope this does not break existing apps. If you have an existing app using auth.signature, please check this does not break it. Massimo On Saturday, 22 December 2012 09:18:48 UTC-6, Niphlod wrote: agreeing too. Someone applying versioning AFTER must know that he must set all current records to True (maybe a note marked important on the relevant section on the book may be appropriate). Better a one-time operation than large where conditions appearing everywhere and killing performances. On Saturday, December 22, 2012 4:00:42 PM UTC+1, Massimo Di Pierro wrote: I think we agree with each other. The problem is that somebody may add auth.signature later and therefore precent records will have is_active=None. The user will have to manually set is_active from None to True. On Saturday, 22 December 2012 07:08:58 UTC-6, Niphlod wrote: uhm the thing is, if you have record versioning, all active records should be marked with True. There's no point in record versioning if active records can be False or True *or None*. They can be either True or False to correctly identify the single active record on those tables. am I missing something ? On Saturday, December 22, 2012 12:52:59 AM UTC+1, Massimo Di Pierro wrote: It is correct in the sense it is what I intended it to be. You are proposing a change of behavior. I see where you are coming from. Please open a ticket about this. I would like to have some more opinions about this. Should None in is_active be treated as True? On Friday, 21 December 2012 14:02:25 UTC-6, Cliff Kachinske wrote: SQL is incorrect. is: AND supplier_contacts.is_active = 'T' should be AND (supplier_contacts.is_active = 'T' OR supplier_contacts.is_active IS NULL) On Friday, December 21, 2012 1:05:16 PM UTC-5, Massimo Di Pierro wrote: It looks to be the generated SQL is correct. It is possible you enabled record versioning and that added the common_filter is_active==True. Yet perhaps you have records with is_active=None and therefore they showed up before and not now. On Friday, 21 December 2012 10:50:13 UTC-6, Cliff Kachinske wrote: Salient details from two tables: db.define_table( 'suppliers', Field('name', length=256, required=True, notnull=True), db.define_table( 'supplier_contacts', Field('supplier_id', db.suppliers), Field('first_name', length=32, required=True, notnull=True), The code below worked in 1.99.7. If the supplier had two contacts, it would return two rows as expected, both with the same supplier data but each with individual contact data. In 2.2.1 it returns no rows. def get_approved_suppliers(product_id): return db( (db.product_suppliers.product_id==product_id) (db.product_suppliers.supplier_id==db.suppliers.id) ).select( db.suppliers.id, db.suppliers.name, # more supplier details omitted for brevity, db.supplier_contacts.id, db.supplier_contacts.first_name, # contact details omitted for brevity. left = db.supplier_contacts.on( db.supplier_contacts.supplier_id==db. suppliers.id ) ) This is the query as shown by db._lastsql. (Broken into chunks for readability) SELECT suppliers.id, suppliers.name, suppliers.address, suppliers. address_2, suppliers.city, suppliers.state, suppliers.zip, suppliers .land_line, suppliers.fax, suppliers.email, suppliers.website,supplier_contacts .id, supplier_contacts.first_name, supplier_contacts.middle_name,supplier_contacts .last_name, supplier_contacts.generation, supplier_contacts.email,supplier_contacts .mobile, supplier_contacts.land_line, supplier_contacts.fax FROM product_suppliers, suppliers LEFT JOIN supplier_contacts ON (supplier_contacts.supplier_id =suppliers .id) WHERE (product_suppliers.product_id = 340) AND ( product_suppliers.supplier_id = suppliers.id)) AND ( product_suppliers.is_active = 'T')) AND (suppliers.is_active = 'T'))AND (supplier_contacts.is_active = 'T')); --
[web2py] Re: web3py?
Hi Massimo, Can webRTC be touched by web2py, (as a feature or as an example) , or by web3py ? here is an example, http://www.youtube.com/watch?v=ZIIcEac24RU and its documentation, https://github.com/priologic/easyrtc/blob/master/docs/easyrtc_client_tutorial.md Regards, Ashraf --
[web2py] Re: how to use session in cookie?
In think the problem is exactly the size of the cookie. On Saturday, 22 December 2012 10:15:20 UTC-6, Adi wrote: Sorry Massimo, Seems I was looking into wrong error_log... This one is related to web2py... JUst run it again: [Sat Dec 22 11:10:53 2012] [error] [client 24.150.57.81] (13)Permission denied: access to /mobipp_us/static/plugin_wiki/rating/jquery.rating.js denied, referer: http://w.replacedserver.com/mobipp_us/category/11 [Sat Dec 22 11:10:57 2012] [error] [client 24.150.57.81] malformed header from script. Bad header=QRZl7DmMFohP98mTnbyI4cEEvQcxWS: wsgihandler.py, referer: http://w.replacedserver.com/mobipp_us/category/11 On Saturday, December 22, 2012 10:32:34 AM UTC-5, Adi wrote: Size could definitely be my problem... Bellow is the bottom part of the Apache error log: [Sat Dec 22 04:22:50 2012] [error] k,len 0 3 [Sat Dec 22 04:22:50 2012] [error] k,len 1 3 [Sat Dec 22 04:22:50 2012] [error] k,len 2 3 [Sat Dec 22 04:22:54 2012] [error] k,len 0 3 [Sat Dec 22 04:22:54 2012] [error] k,len 1 3 [Sat Dec 22 04:22:54 2012] [error] k,len 2 3 [Sat Dec 22 07:39:04 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T12:39:04Z'], 'TOKEN': ['EC-25J033232E8733719'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['2fcce583dd4e2']} [Sat Dec 22 08:18:29 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T13:18:29Z'], 'TOKEN': ['EC-3RG928080L406004A'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['bea4a71f87268']} [Sat Dec 22 08:25:17 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T13:25:17Z'], 'TOKEN': ['EC-7GY27898JG123493D'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['3941637927a28']} [Sat Dec 22 08:26:09 2012] [error] k,len 0 1 [Sat Dec 22 08:26:23 2012] [error] k,len 0 1 I would like to steer away from db sessions, since we had a large problem when doing PCI compliance test with nCircle... They could literally bring our websites down due to opening million parallel connections, which should be fine... The error was on our side :) Memcache resolved that problem, but that was with php. Now, I would like to use the similar approach with web2py, and then we can test a pci scan :) On Saturday, December 22, 2012 10:02:28 AM UTC-5, Massimo Di Pierro wrote: Can you please look for the error in the apache logs? There is a limitation in the cookie size wich may break for large sessions. On Saturday, 22 December 2012 08:49:04 UTC-6, Adi wrote: I tried using session.connect(cookie_key='key', compression_level=9) instead of session.connect(request, response, db=db), and got theerror as bellow, plus some inconsistent unexpected behavior. When I rolled back to db sessions all works fine as expected. It's an e-commerce app, using sessions bit heavier. Are there known limitations for using cookie sessions? Also, if I can use memcache with mysql, how do I define a client? Tried mc = memcache.Client(['127.0.0.1:11211'], debug=0), with no success... Thanks, Adnan web2py: Version 2.3.2 (2012-12-17 15:03:30) stable OK The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Apache/2.2.3 (Red Hat) Server at w2p.demo.com Port 80 --
[web2py] Re: web3py?
Very interesting. Looks like it completely client-side so it should work without problems with web2py. Massimo On Saturday, 22 December 2012 11:35:33 UTC-6, webpypy wrote: Hi Massimo, Can webRTC be touched by web2py, (as a feature or as an example) , or by web3py ? here is an example, http://www.youtube.com/watch?v=ZIIcEac24RU and its documentation, https://github.com/priologic/easyrtc/blob/master/docs/easyrtc_client_tutorial.md Regards, Ashraf --
Re: [web2py] how to cleanse field value
Thank you! On Wednesday, December 19, 2012 7:04:03 PM UTC-5, Massimo Di Pierro wrote: Here is a custom validator that replaces '-' with '_' class MyValidator(obejct): def __call__(self,value): return (value.replace('-','_'), None) Field(..., requires=MyValidator()...) On Wednesday, 19 December 2012 16:54:21 UTC-6, wwwgong wrote: I thought validator only validates, can you show me how to update field with the sanitized value. Thanks, On Wednesday, December 19, 2012 9:57:48 AM UTC-5, viniciusban wrote: Try a custom validator to sanitize your description field. On Wed, Dec 19, 2012 at 12:06 PM, wwwgong wen.g...@gmail.com wrote: Hi, I like to store youtube videos into a table: db.define_table('youtube', Field('code'), Field('description') ) def youtube_repr(code,width=400,height=250): return XML( object width=%(width)s height=%(height)s param name=movie value=http://www.youtube.com/v/%(code)shl=en_USfs=1/param param name=allowFullScreen value=true/param param name=allowscriptaccess value=always/param embed src=http://www.youtube.com/v/%(code)shl=en_USfs=1 type=application/x-shockwave-flash allowscriptaccess=always allowfullscreen=true width=%(width)s height=%(height)s/embed /object % dict(code=code, width=width, height=height) ) db.youtube.code.represent = youtube_repr with this controller: def youtube_video(): form = SQLFORM.grid(db.youtube) return dict(form=form) If the description field contains double quote char {}, it will messes up, see screenshot at http://dl.dropbox.com/u/54552252/cleanse-web2py-field-value.jpg I know web2py offers custom validator to detect special char in Form field, but is it possible to attach a pre-process function at DAL layer to cleanse field value before db operation? Something like: db.youtube.description.preprocess = cleanse_special_char where cleanse_special_char is a function to cleanse db.youtube.description field value Can someone offer a solution or workaround? Thanks, Wen -- --
[web2py] help testing auth.signature with mysql/pgsql
If you have fields with auth.signature and mysql/pgsql could you help me test the latest trunk? The reason is that I changed the is_active field from notnull=False to notnull=True. This should trigger a migration of your data. I want to make sure nothing breaks. Can you confirm this is ok? Massimo --
[web2py] Re: web3py?
Do you prefer it as feature or example? On Saturday, December 22, 2012 8:39:18 PM UTC+3, Massimo Di Pierro wrote: Very interesting. Looks like it completely client-side so it should work without problems with web2py. Massimo On Saturday, 22 December 2012 11:35:33 UTC-6, webpypy wrote: Hi Massimo, Can webRTC be touched by web2py, (as a feature or as an example) , or by web3py ? here is an example, http://www.youtube.com/watch?v=ZIIcEac24RU and its documentation, https://github.com/priologic/easyrtc/blob/master/docs/easyrtc_client_tutorial.md Regards, Ashraf --
[web2py] geodal
I made some changes to the DAL geo APIs. This is an experimental feature so we are allowed to make changes. Anyway, the changes should be backward compatible. The only issue is that I am documenting the geodal api in the book and I would not want to change them later. Can you please check them: The DAL supports geographical APIs using PostGIS (for PostgreSQL), spatialite (for SQLite), and MSSQL and Spatial Extensions. DAL provides geometry and geography fields types and the following functions: st_asgeojson (PostGIS only) st_astext st_contained st_contains st_distance st_equals st_intersects st_overlaps st_simplify (PostGIS only) st_touches st_within examples: from gluon.dal import DAL, Field, geoPoint, geoLine, geoPolygon db = DAL(mssql://user:pass@host:db) sp = db.define_table('spatial',Field('loc','geometry()')) sp.insert(loc=geoPoint(1,1)) sp.insert(loc=geoLine((100,100),(20,180),(180,180))) sp.insert(loc=geoPolygon((0,0),(150,0),(150,150),(0,150),(0,0))) print db(sp.id0).select() spatial.id,spatial.loc 1, POINT (1 2) 2, LINESTRING (100 100, 20 180, 180 180) 3, POLYGON ((0 0, 150 0, 150 150, 0 150, 0 0)) query = sp.loc.st_intersects(geoLine((20,120),(60,160))) query = sp.loc.st_overlaps(geoPolygon((1,1),(11,1),(11,11),(11,1),(1,1))) query = sp.loc.st_contains(geoPoint(1,1)) print db(query).select(sp.id,sp.loc) spatial.id,spatial.loc 3,POLYGNON ((0 0, 150 0, 150 150, 0 150, 0 0)) dist = sp.loc.st_distance(geoPoint(-1,2)).with_alias('dist') print db(sp.id0).select(sp.id, dist) spatial.id, dist 1 2.0 2 140.714249456 3 1.0 --
[web2py] Re: web3py?
I do not understand the question. On Saturday, 22 December 2012 11:44:24 UTC-6, webpypy wrote: Do you prefer it as feature or example? On Saturday, December 22, 2012 8:39:18 PM UTC+3, Massimo Di Pierro wrote: Very interesting. Looks like it completely client-side so it should work without problems with web2py. Massimo On Saturday, 22 December 2012 11:35:33 UTC-6, webpypy wrote: Hi Massimo, Can webRTC be touched by web2py, (as a feature or as an example) , or by web3py ? here is an example, http://www.youtube.com/watch?v=ZIIcEac24RU and its documentation, https://github.com/priologic/easyrtc/blob/master/docs/easyrtc_client_tutorial.md Regards, Ashraf --
[web2py] Re: web3py?
I mean, do we expect a web2py example that use webRTC or do we expect a core feature in web2py(or web3py) that interface with the cam and mic? --
Re: [web2py] geodal
Excelent! I did not know DAL has its support, In my new project I will use this with Postgres, trying to test it today. Thank you again. --
[web2py] Re: how to use session in cookie?
Thanks Massimo. So, is session.connect(request, response, db=db) my only option for mysql at the moment? i tried to get memcache working, but getting stuck with syntax... is there a valid sample somewhere? In one of the posts I found this code, but getting an error bellow... from gluon.contrib.memcache import MemcacheClient memcache_servers = ['127.0.0.1:11211'] cache.memcache = MemcacheClient(request, memcache_servers) cache.ram = cache.disk = cache.memcache from gluon.contrib.memdb import MEMDB session.connect(request,response,db=MEMDB(cache.memcache)) session.connect(request, response, db=MEMDB(cache.memcache)) 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Traceback (most recent call last): File /Users/adnan/web2py24/gluon/main.py, line 557, in wsgibase session._try_store_in_db(request, response) File /Users/adnan/web2py24/gluon/globals.py, line 739, in _try_store_in_db record_id = table.insert(**dd) File /Users/adnan/web2py24/gluon/contrib/memdb.py, line 256, in insert id = self._create_id() File /Users/adnan/web2py24/gluon/contrib/memdb.py, line 296, in _create_id raise Exception('cannot set memcache') Exception: cannot set memcache Frames - *File /Users/adnan/web2py24/gluon/main.py in wsgibase at line 557* code arguments variables *File /Users/adnan/web2py24/gluon/globals.py in_try_store_in_db at line 739* code arguments variables *File /Users/adnan/web2py24/gluon/contrib/memdb.py in insert at line 256* code arguments variables *File /Users/adnan/web2py24/gluon/contrib/memdb.py in_create_id at line 296* code arguments variables Function argument list (self=DALStorage {'client_ip': gluon.contrib.memdb.F...luon.contrib. memdb.Field object at 0x113dc9a90}) Code listing 291. 292. 293. 294. 295. 296. 297. 298. 299. 300. id = self._tableobj.incr(shard_id) if not id: if self._tableobj.set(shard_id, '0'): id = 0 else: raise Exception('cannot set memcache') return long(str(shard) + str(id)) def __str__(self): return self._tablename - Enter code here... On Saturday, December 22, 2012 12:38:06 PM UTC-5, Massimo Di Pierro wrote: In think the problem is exactly the size of the cookie. On Saturday, 22 December 2012 10:15:20 UTC-6, Adi wrote: Sorry Massimo, Seems I was looking into wrong error_log... This one is related to web2py... JUst run it again: [Sat Dec 22 11:10:53 2012] [error] [client 24.150.57.81] (13)Permission denied: access to /mobipp_us/static/plugin_wiki/rating/jquery.rating.js denied, referer: http://w.replacedserver.com/mobipp_us/category/11 [Sat Dec 22 11:10:57 2012] [error] [client 24.150.57.81] malformed header from script. Bad header=QRZl7DmMFohP98mTnbyI4cEEvQcxWS: wsgihandler.py, referer: http://w.replacedserver.com/mobipp_us/category/11 On Saturday, December 22, 2012 10:32:34 AM UTC-5, Adi wrote: Size could definitely be my problem... Bellow is the bottom part of the Apache error log: [Sat Dec 22 04:22:50 2012] [error] k,len 0 3 [Sat Dec 22 04:22:50 2012] [error] k,len 1 3 [Sat Dec 22 04:22:50 2012] [error] k,len 2 3 [Sat Dec 22 04:22:54 2012] [error] k,len 0 3 [Sat Dec 22 04:22:54 2012] [error] k,len 1 3 [Sat Dec 22 04:22:54 2012] [error] k,len 2 3 [Sat Dec 22 07:39:04 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T12:39:04Z'], 'TOKEN': ['EC-25J033232E8733719'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['2fcce583dd4e2']} [Sat Dec 22 08:18:29 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T13:18:29Z'], 'TOKEN': ['EC-3RG928080L406004A'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['bea4a71f87268']} [Sat Dec 22 08:25:17 2012] [error] {'ACK': ['Success'], 'TIMESTAMP': ['2012-12-22T13:25:17Z'], 'TOKEN': ['EC-7GY27898JG123493D'], 'VERSION': ['95.0'], 'BUILD': ['4181146'], 'CORRELATIONID': ['3941637927a28']} [Sat Dec 22 08:26:09 2012] [error] k,len 0 1 [Sat Dec 22 08:26:23 2012] [error] k,len 0 1 I would like to steer away from db sessions, since we had a large problem when doing PCI compliance test with nCircle... They could literally bring our websites down due to opening million parallel connections, which should be fine... The error was on our side :) Memcache resolved that problem, but that was with php. Now, I would like to use the similar approach with web2py, and then we can test a pci scan :)
[web2py] Re: help testing auth.signature with mysql/pgsql
do you mean: db._common_fields.append(auth.signature) i have it, and can test now On Saturday, December 22, 2012 12:44:06 PM UTC-5, Massimo Di Pierro wrote: If you have fields with auth.signature and mysql/pgsql could you help me test the latest trunk? The reason is that I changed the is_active field from notnull=False to notnull=True. This should trigger a migration of your data. I want to make sure nothing breaks. Can you confirm this is ok? Massimo --
[web2py] Re: web3py?
At this time none of them since my priority if finish the book by next week. ;-) After that we'll see. As I said before the library is client side. I am not sure there is anything web2py specific. An example would be nice. Masimo On Saturday, 22 December 2012 11:55:16 UTC-6, webpypy wrote: I mean, do we expect a web2py example that use webRTC or do we expect a core feature in web2py(or web3py) that interface with the cam and mic? --
Re: [web2py] geodal
For the record, this feature has been in since summer 2011. It was sponsored by the Sahana project and implemented by Denes. It was only documented in an email from Denes. I have now added it to the manual and changed the APIs a little to make more human friendly. The API could use more work but the problem is that I do not fully understand differences between geo engines and therefore I am reluctant to change them too much. On Saturday, 22 December 2012 12:26:48 UTC-6, rochacbruno wrote: Excelent! I did not know DAL has its support, In my new project I will use this with Postgres, trying to test it today. Thank you again. --
[web2py] Re: help testing auth.signature with mysql/pgsql
Yes. That would be a good test. On Saturday, 22 December 2012 12:30:25 UTC-6, Adi wrote: do you mean: db._common_fields.append(auth.signature) i have it, and can test now On Saturday, December 22, 2012 12:44:06 PM UTC-5, Massimo Di Pierro wrote: If you have fields with auth.signature and mysql/pgsql could you help me test the latest trunk? The reason is that I changed the is_active field from notnull=False to notnull=True. This should trigger a migration of your data. I want to make sure nothing breaks. Can you confirm this is ok? Massimo --
[web2py] Re: help testing auth.signature with mysql/pgsql
Specifically let me know: - after upgrade, do you see a migration in sql.log? - does everything seem to work or you get a ticket? Masimo On Saturday, 22 December 2012 12:30:25 UTC-6, Adi wrote: do you mean: db._common_fields.append(auth.signature) i have it, and can test now On Saturday, December 22, 2012 12:44:06 PM UTC-5, Massimo Di Pierro wrote: If you have fields with auth.signature and mysql/pgsql could you help me test the latest trunk? The reason is that I changed the is_active field from notnull=False to notnull=True. This should trigger a migration of your data. I want to make sure nothing breaks. Can you confirm this is ok? Massimo --
Re: [web2py] Possible bug in JSONRPC in v2.3.2
Thanks guys. On Saturday, December 22, 2012 6:59:10 AM UTC-8, Massimo Di Pierro wrote: Turns out we do not have a choice. params is a variable specified by jsonrpc. It can be an array or an object. The change in trunk was wrong as we need to check whether it is an array or an object (serialized as dict). and act accordingly. It should now be fixed in trunk. Massimo On Saturday, 22 December 2012 07:03:36 UTC-6, Niphlod wrote: both of you, jump on the bandwagon here . https://groups.google.com/d/topic/web2py/5kCYP-wiELo/discussion On Saturday, December 22, 2012 7:04:18 AM UTC+1, rochacbruno wrote: On Sat, Dec 22, 2012 at 3:57 AM, Mike D mike@gmail.com wrote: s = methods[method](**params) I guess it should be s = methods[method](*args, **params) to be more flexible --
[web2py] Re: web3py?
Thank you, Massimo. --
[web2py] Call controller automatically
Dear. I have a controller that basically runs a SQL shown in their respective views. Need is that while the user STAY in this view, the controller automatically running every 5 seconds, and so the result of the SQL refresh the view. I could use a Refresh button, but I want it to be automatic. How i can do? Fernando --
[web2py] 2 Bugs in web2py Examples # 29
Dear web2py users, While trying to work my way through smartgrid, i discovered that there are 2 Bugs in the web2py documentation [quick] Examples # 29. See: https://www.web2py.com/examples/default/examples#database_examples 1. around line 11. #BUG: Field https://www.web2py.com/examples/global/vars/Field('seller_id', db_person), #GOOD: Field https://www.web2py.com/examples/global/vars/Field('seller_id',db. person), 2. around line 26. #BUG: purchased = \n(db.person.id==db.purchase.buyer_id)\n (db.product.id==db.purchase.product_id) #GOOD: purchased = (db.person.id==db.purchase.buyer_id) (db.product.id==db.purchase.product_id) Thanks for the GREAT framework. Love and peace, Joe --
[web2py] Re: help testing auth.signature with mysql/pgsql
My app was in a fake migration mode, and when I enabled a migration it wanted to re-ecreate two existing tables, one regular (pmt), the other archive (customer_archive)... (sql.log bellow). I renamed existing tables in order to proceed... What I see is that archive table got created with is_active notnull, and default T, while existing tables stayed as is... Tried updating record in customer table and all worked ok... sql.log: timestamp: 2012-12-22T13:57:59.269217 ALTER TABLE lookup ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE lookup SET is_active__tmp=is_active; faked! ALTER TABLE lookup DROP COLUMN is_active; faked! ALTER TABLE lookup ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE lookup SET is_active=is_active__tmp; faked! ALTER TABLE lookup DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.298807 ALTER TABLE comment ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE comment SET is_active__tmp=is_active; faked! ALTER TABLE comment DROP COLUMN is_active; faked! ALTER TABLE comment ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE comment SET is_active=is_active__tmp; faked! ALTER TABLE comment DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.342240 ALTER TABLE configuration ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE configuration SET is_active__tmp=is_active; faked! ALTER TABLE configuration DROP COLUMN is_active; faked! ALTER TABLE configuration ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE configuration SET is_active=is_active__tmp; faked! ALTER TABLE configuration DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.375178 ALTER TABLE supplier ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE supplier SET is_active__tmp=is_active; faked! ALTER TABLE supplier DROP COLUMN is_active; faked! ALTER TABLE supplier ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE supplier SET is_active=is_active__tmp; faked! ALTER TABLE supplier DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.415936 ALTER TABLE customer ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE customer SET is_active__tmp=is_active; faked! ALTER TABLE customer DROP COLUMN is_active; faked! ALTER TABLE customer ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE customer SET is_active=is_active__tmp; faked! ALTER TABLE customer DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.464933 ALTER TABLE next_po_number ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE next_po_number SET is_active__tmp=is_active; faked! ALTER TABLE next_po_number DROP COLUMN is_active; faked! ALTER TABLE next_po_number ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE next_po_number SET is_active=is_active__tmp; faked! ALTER TABLE next_po_number DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.511872 ALTER TABLE purchase_order ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE purchase_order SET is_active__tmp=is_active; faked! ALTER TABLE purchase_order DROP COLUMN is_active; faked! ALTER TABLE purchase_order ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE purchase_order SET is_active=is_active__tmp; faked! ALTER TABLE purchase_order DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.618962 ALTER TABLE product_family ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE product_family SET is_active__tmp=is_active; faked! ALTER TABLE product_family DROP COLUMN is_active; faked! ALTER TABLE product_family ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE product_family SET is_active=is_active__tmp; faked! ALTER TABLE product_family DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.650635 ALTER TABLE sku ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE sku SET is_active__tmp=is_active; faked! ALTER TABLE sku DROP COLUMN is_active; faked! ALTER TABLE sku ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE sku SET is_active=is_active__tmp; faked! ALTER TABLE sku DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.688207 ALTER TABLE item ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE item SET is_active__tmp=is_active; faked! ALTER TABLE item DROP COLUMN is_active; faked! ALTER TABLE item ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE item SET is_active=is_active__tmp; faked! ALTER TABLE item DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T14:05:28.630734 CREATE TABLE pmt( id INT AUTO_INCREMENT NOT NULL, tbl_uuid VARCHAR(64), po_id INT, INDEX po_id__idx (po_id), FOREIGN KEY (po_id) REFERENCES purchase_order (id) ON DELETE CASCADE, currency VARCHAR(255), invoice_no VARCHAR(255), amount_paid DOUBLE, date_wire_actg DATE, partial_payment VARCHAR(255), amount_paid2 DOUBLE, date_to_actg2 DATE, amount_paid3 DOUBLE, date_to_actg3 DATE, amount_paid4
[web2py] Re: help testing auth.signature with mysql/pgsql
This is not exactly what I was hoping for but it shows a problem with trunk. It migrates is_active form notnull=False to notnull=True and then tries to copy the old data (which include Null values). This will break the migration. It worked for you because the step was only faked. The creation of the new table is never a problem. I have reverted the change in trunk. Massimo On Saturday, 22 December 2012 13:28:13 UTC-6, Adi wrote: My app was in a fake migration mode, and when I enabled a migration it wanted to re-ecreate two existing tables, one regular (pmt), the other archive (customer_archive)... (sql.log bellow). I renamed existing tables in order to proceed... What I see is that archive table got created with is_active notnull, and default T, while existing tables stayed as is... Tried updating record in customer table and all worked ok... sql.log: timestamp: 2012-12-22T13:57:59.269217 ALTER TABLE lookup ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE lookup SET is_active__tmp=is_active; faked! ALTER TABLE lookup DROP COLUMN is_active; faked! ALTER TABLE lookup ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE lookup SET is_active=is_active__tmp; faked! ALTER TABLE lookup DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.298807 ALTER TABLE comment ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE comment SET is_active__tmp=is_active; faked! ALTER TABLE comment DROP COLUMN is_active; faked! ALTER TABLE comment ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE comment SET is_active=is_active__tmp; faked! ALTER TABLE comment DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.342240 ALTER TABLE configuration ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE configuration SET is_active__tmp=is_active; faked! ALTER TABLE configuration DROP COLUMN is_active; faked! ALTER TABLE configuration ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE configuration SET is_active=is_active__tmp; faked! ALTER TABLE configuration DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.375178 ALTER TABLE supplier ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE supplier SET is_active__tmp=is_active; faked! ALTER TABLE supplier DROP COLUMN is_active; faked! ALTER TABLE supplier ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE supplier SET is_active=is_active__tmp; faked! ALTER TABLE supplier DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.415936 ALTER TABLE customer ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE customer SET is_active__tmp=is_active; faked! ALTER TABLE customer DROP COLUMN is_active; faked! ALTER TABLE customer ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE customer SET is_active=is_active__tmp; faked! ALTER TABLE customer DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.464933 ALTER TABLE next_po_number ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE next_po_number SET is_active__tmp=is_active; faked! ALTER TABLE next_po_number DROP COLUMN is_active; faked! ALTER TABLE next_po_number ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE next_po_number SET is_active=is_active__tmp; faked! ALTER TABLE next_po_number DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.511872 ALTER TABLE purchase_order ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE purchase_order SET is_active__tmp=is_active; faked! ALTER TABLE purchase_order DROP COLUMN is_active; faked! ALTER TABLE purchase_order ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE purchase_order SET is_active=is_active__tmp; faked! ALTER TABLE purchase_order DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.618962 ALTER TABLE product_family ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE product_family SET is_active__tmp=is_active; faked! ALTER TABLE product_family DROP COLUMN is_active; faked! ALTER TABLE product_family ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE product_family SET is_active=is_active__tmp; faked! ALTER TABLE product_family DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.650635 ALTER TABLE sku ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE sku SET is_active__tmp=is_active; faked! ALTER TABLE sku DROP COLUMN is_active; faked! ALTER TABLE sku ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE sku SET is_active=is_active__tmp; faked! ALTER TABLE sku DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.688207 ALTER TABLE item ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE item SET is_active__tmp=is_active; faked! ALTER TABLE item DROP COLUMN is_active; faked! ALTER TABLE item ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE item
[web2py] Small form on all pages..
What is the best way to create a small form that is visible on all pages? I want to have a small form in the sidebar where users can add notes (without changing view..) I have tried just adding the for in the layout and send the data to a controller using an ajax function: onsubmit=ajax('{{=URL(c='settings',f='add_mote')}}', ['note_id'], '') In the controller I then have a simple function that adds the data sent from the form into the database. The problem is that this approach seems unstable. For some reason only 4/5 substitution are able to call the controller and some data is lost. What is the proper way to do this? Best regards Harald --
[web2py] should re remove crud from the book?
I am finishing up the book 5th edition. I was to remove every mention of the crud API. Almost all of the functionality has been moved into SQLFORM(...).process(). The latter is in fact better. The crud code has not been updated in long time and should be deprecated. The code will stay and we are not breaking it. Should we remove it form the book completely or simply leave the chapter and mark is as reprecated. massimo --
Re: [web2py] should re remove crud from the book?
On 22 Dec 2012, at 11:44 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I am finishing up the book 5th edition. I was to remove every mention of the crud API. Almost all of the functionality has been moved into SQLFORM(...).process(). The latter is in fact better. The crud code has not been updated in long time and should be deprecated. The code will stay and we are not breaking it. Should we remove it form the book completely or simply leave the chapter and mark is as reprecated. If we mark it deprecated, we should define (in the book) exactly what we mean by that. --
Re: [web2py] should re remove crud from the book?
I am going over the book with grep. The problems are these: 1) crud checks permission, SQLFORM does not. 2) crud is used in welcome 3) in chapter 13 we say plugins can rely on crud. So on a second thought we cannot easily remove it form the book. I will remove some examples to avoid using crud. I will provide examples of how to enforce permissions with SQLFORM without using crud. I add a notice at the beginning of the crud chapter to suggest using SQLFORM instead of crud. We cannot remove it from welcome app because plugins require it. Therefore we cannot remove it from book quote yet. I am not too happy about this but I cannot think of a better solution. Massimo On Saturday, 22 December 2012 13:48:39 UTC-6, Jonathan Lundell wrote: On 22 Dec 2012, at 11:44 AM, Massimo Di Pierro massimo@gmail.comjavascript: wrote: I am finishing up the book 5th edition. I was to remove every mention of the crud API. Almost all of the functionality has been moved into SQLFORM(...).process(). The latter is in fact better. The crud code has not been updated in long time and should be deprecated. The code will stay and we are not breaking it. Should we remove it form the book completely or simply leave the chapter and mark is as reprecated. If we mark it deprecated, we should define (in the book) exactly what we mean by that. --
[web2py] Re: help testing auth.signature with mysql/pgsql
let me know when you change. i can test again... On Saturday, December 22, 2012 2:40:19 PM UTC-5, Massimo Di Pierro wrote: This is not exactly what I was hoping for but it shows a problem with trunk. It migrates is_active form notnull=False to notnull=True and then tries to copy the old data (which include Null values). This will break the migration. It worked for you because the step was only faked. The creation of the new table is never a problem. I have reverted the change in trunk. Massimo On Saturday, 22 December 2012 13:28:13 UTC-6, Adi wrote: My app was in a fake migration mode, and when I enabled a migration it wanted to re-ecreate two existing tables, one regular (pmt), the other archive (customer_archive)... (sql.log bellow). I renamed existing tables in order to proceed... What I see is that archive table got created with is_active notnull, and default T, while existing tables stayed as is... Tried updating record in customer table and all worked ok... sql.log: timestamp: 2012-12-22T13:57:59.269217 ALTER TABLE lookup ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE lookup SET is_active__tmp=is_active; faked! ALTER TABLE lookup DROP COLUMN is_active; faked! ALTER TABLE lookup ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE lookup SET is_active=is_active__tmp; faked! ALTER TABLE lookup DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.298807 ALTER TABLE comment ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE comment SET is_active__tmp=is_active; faked! ALTER TABLE comment DROP COLUMN is_active; faked! ALTER TABLE comment ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE comment SET is_active=is_active__tmp; faked! ALTER TABLE comment DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.342240 ALTER TABLE configuration ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE configuration SET is_active__tmp=is_active; faked! ALTER TABLE configuration DROP COLUMN is_active; faked! ALTER TABLE configuration ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE configuration SET is_active=is_active__tmp; faked! ALTER TABLE configuration DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.375178 ALTER TABLE supplier ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE supplier SET is_active__tmp=is_active; faked! ALTER TABLE supplier DROP COLUMN is_active; faked! ALTER TABLE supplier ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE supplier SET is_active=is_active__tmp; faked! ALTER TABLE supplier DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.415936 ALTER TABLE customer ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE customer SET is_active__tmp=is_active; faked! ALTER TABLE customer DROP COLUMN is_active; faked! ALTER TABLE customer ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE customer SET is_active=is_active__tmp; faked! ALTER TABLE customer DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.464933 ALTER TABLE next_po_number ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE next_po_number SET is_active__tmp=is_active; faked! ALTER TABLE next_po_number DROP COLUMN is_active; faked! ALTER TABLE next_po_number ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE next_po_number SET is_active=is_active__tmp; faked! ALTER TABLE next_po_number DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.511872 ALTER TABLE purchase_order ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE purchase_order SET is_active__tmp=is_active; faked! ALTER TABLE purchase_order DROP COLUMN is_active; faked! ALTER TABLE purchase_order ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE purchase_order SET is_active=is_active__tmp; faked! ALTER TABLE purchase_order DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.618962 ALTER TABLE product_family ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE product_family SET is_active__tmp=is_active; faked! ALTER TABLE product_family DROP COLUMN is_active; faked! ALTER TABLE product_family ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE product_family SET is_active=is_active__tmp; faked! ALTER TABLE product_family DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.650635 ALTER TABLE sku ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE sku SET is_active__tmp=is_active; faked! ALTER TABLE sku DROP COLUMN is_active; faked! ALTER TABLE sku ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE sku SET is_active=is_active__tmp; faked! ALTER TABLE sku DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.688207 ALTER TABLE item ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE item SET is_active__tmp=is_active;
[web2py] controller not returning variables
this is probably simple but I post it anyway I have a layout that includes sidebar.html: section id=main class=main row br br div class=span2 left-sidebar offset1 !-- div class=headerDivider/div -- {{block left_sidebar}} {{include 'default/sidebar.html'}} {{end}} /div and sidebar.html: {{left_sidebar_enable=True}} h4i class=icon-user/i me (from sidebar.html):/h4 {{for pre in about:}} {{for pr in pre.presentation.split():}} dl class=dl ddi class=icon-check/i {{=pr}}/dd /dl {{pass}} h5i class=icon-arrow-right/i Contact: {{=pre.contact}}/h5 {{pass}} however, my controller returns variables but I cannot see them in the view. When checking, the controller is not even called: def sidebar(): query=db.about.id0 ab=db(query).select() print 'called sidebar' return dict(ab=ab) the view is in view/default and the controller is in controller/default.py why is not the controller called? --
[web2py] Re: help testing auth.signature with mysql/pgsql
I reverted it so there should be no problem. This leave the original problem. If people add an auth signature, they must manually change is_active=None to is_active=True. On Saturday, 22 December 2012 13:59:13 UTC-6, Adi wrote: let me know when you change. i can test again... On Saturday, December 22, 2012 2:40:19 PM UTC-5, Massimo Di Pierro wrote: This is not exactly what I was hoping for but it shows a problem with trunk. It migrates is_active form notnull=False to notnull=True and then tries to copy the old data (which include Null values). This will break the migration. It worked for you because the step was only faked. The creation of the new table is never a problem. I have reverted the change in trunk. Massimo On Saturday, 22 December 2012 13:28:13 UTC-6, Adi wrote: My app was in a fake migration mode, and when I enabled a migration it wanted to re-ecreate two existing tables, one regular (pmt), the other archive (customer_archive)... (sql.log bellow). I renamed existing tables in order to proceed... What I see is that archive table got created with is_active notnull, and default T, while existing tables stayed as is... Tried updating record in customer table and all worked ok... sql.log: timestamp: 2012-12-22T13:57:59.269217 ALTER TABLE lookup ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE lookup SET is_active__tmp=is_active; faked! ALTER TABLE lookup DROP COLUMN is_active; faked! ALTER TABLE lookup ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE lookup SET is_active=is_active__tmp; faked! ALTER TABLE lookup DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.298807 ALTER TABLE comment ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE comment SET is_active__tmp=is_active; faked! ALTER TABLE comment DROP COLUMN is_active; faked! ALTER TABLE comment ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE comment SET is_active=is_active__tmp; faked! ALTER TABLE comment DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.342240 ALTER TABLE configuration ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE configuration SET is_active__tmp=is_active; faked! ALTER TABLE configuration DROP COLUMN is_active; faked! ALTER TABLE configuration ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE configuration SET is_active=is_active__tmp; faked! ALTER TABLE configuration DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.375178 ALTER TABLE supplier ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE supplier SET is_active__tmp=is_active; faked! ALTER TABLE supplier DROP COLUMN is_active; faked! ALTER TABLE supplier ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE supplier SET is_active=is_active__tmp; faked! ALTER TABLE supplier DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.415936 ALTER TABLE customer ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE customer SET is_active__tmp=is_active; faked! ALTER TABLE customer DROP COLUMN is_active; faked! ALTER TABLE customer ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE customer SET is_active=is_active__tmp; faked! ALTER TABLE customer DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.464933 ALTER TABLE next_po_number ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE next_po_number SET is_active__tmp=is_active; faked! ALTER TABLE next_po_number DROP COLUMN is_active; faked! ALTER TABLE next_po_number ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE next_po_number SET is_active=is_active__tmp; faked! ALTER TABLE next_po_number DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.511872 ALTER TABLE purchase_order ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE purchase_order SET is_active__tmp=is_active; faked! ALTER TABLE purchase_order DROP COLUMN is_active; faked! ALTER TABLE purchase_order ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE purchase_order SET is_active=is_active__tmp; faked! ALTER TABLE purchase_order DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.618962 ALTER TABLE product_family ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE product_family SET is_active__tmp=is_active; faked! ALTER TABLE product_family DROP COLUMN is_active; faked! ALTER TABLE product_family ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE product_family SET is_active=is_active__tmp; faked! ALTER TABLE product_family DROP COLUMN is_active__tmp; faked! timestamp: 2012-12-22T13:57:59.650635 ALTER TABLE sku ADD is_active__tmp CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE sku SET is_active__tmp=is_active; faked! ALTER TABLE sku DROP COLUMN is_active; faked! ALTER TABLE sku ADD is_active CHAR(1) NOT NULL DEFAULT 'T'; faked! UPDATE sku SET
[web2py] Re: controller not returning variables
When you include a view like: {{include 'default/sidebar.html'}} it is not calling a sidebar() function in the default.py controller. Rather, it is simply including the code from the sidebar.html file at that point in your main view file, as if the code had been manually inserted there. No additional controller functions are called. For a single request, only one controller function is called. When that function returns, its view is rendered, and that view can be constructed by extending and including other views -- but the other views do not call their own controller functions. Anthony On Saturday, December 22, 2012 3:11:38 PM UTC-5, jonas wrote: this is probably simple but I post it anyway I have a layout that includes sidebar.html: section id=main class=main row br br div class=span2 left-sidebar offset1 !-- div class=headerDivider/div -- {{block left_sidebar}} {{include 'default/sidebar.html'}} {{end}} /div and sidebar.html: {{left_sidebar_enable=True}} h4i class=icon-user/i me (from sidebar.html):/h4 {{for pre in about:}} {{for pr in pre.presentation.split():}} dl class=dl ddi class=icon-check/i {{=pr}}/dd /dl {{pass}} h5i class=icon-arrow-right/i Contact: {{=pre.contact}}/h5 {{pass}} however, my controller returns variables but I cannot see them in the view. When checking, the controller is not even called: def sidebar(): query=db.about.id0 ab=db(query).select() print 'called sidebar' return dict(ab=ab) the view is in view/default and the controller is in controller/default.py why is not the controller called? --
[web2py] Re: Call controller automatically
Perhaps you could use an ajax component (see http://web2py.com/books/default/chapter/29/12#Components): {{=LOAD(..., timeout=5000, times='infinity', ajax=True)}} That will load the component via Ajax and refresh its content every 5 seconds indefinitely. Anthony On Saturday, December 22, 2012 2:23:14 PM UTC-5, visuallinux wrote: Dear. I have a controller that basically runs a SQL shown in their respective views. Need is that while the user STAY in this view, the controller automatically running every 5 seconds, and so the result of the SQL refresh the view. I could use a Refresh button, but I want it to be automatic. How i can do? Fernando --
[web2py] Re: Query results from 2 children tables from same parent ordered by date
ok find it too using this code in view: {{for e in exams_mutex:}} divh1Examen du {{=e['COALESCE(dataset1.date,dataset2.date)']}}/h1/div {{pass}} Le samedi 22 décembre 2012 08:27:03 UTC+1, Mamisoa Andriantafika a écrit : I actually need to display those coalesce dates out of SQLTABLE that I use in view. To be precise, I need to show in LI(date, LI(all parameters)). --
Re: [web2py] Re: controller not returning variables
Ok, I have a {{include}} statement in the beginning of the layout.html file that cals index.html and the corresponding index.py controller. And that one returns variables. So there is no way to call sidebar.py with tve corresponding view to get the variables? 22 dec 2012 kl. 20:53 skrev Anthony abasta...@gmail.com: When you include a view like: {{include 'default/sidebar.html'}} it is not calling a sidebar() function in the default.py controller. Rather, it is simply including the code from the sidebar.html file at that point in your main view file, as if the code had been manually inserted there. No additional controller functions are called. For a single request, only one controller function is called. When that function returns, its view is rendered, and that view can be constructed by extending and including other views -- but the other views do not call their own controller functions. Anthony On Saturday, December 22, 2012 3:11:38 PM UTC-5, jonas wrote: this is probably simple but I post it anyway I have a layout that includes sidebar.html: section id=main class=main row br br div class=span2 left-sidebar offset1 !-- div class=headerDivider/div -- {{block left_sidebar}} {{include 'default/sidebar.html'}} {{end}} /div and sidebar.html: {{left_sidebar_enable=True}} h4i class=icon-user/i me (from sidebar.html):/h4 {{for pre in about:}} {{for pr in pre.presentation.split():}} dl class=dl ddi class=icon-check/i {{=pr}}/dd /dl {{pass}} h5i class=icon-arrow-right/i Contact: {{=pre.contact}}/h5 {{pass}} however, my controller returns variables but I cannot see them in the view. When checking, the controller is not even called: def sidebar(): query=db.about.id0 ab=db(query).select() print 'called sidebar' return dict(ab=ab) the view is in view/default and the controller is in controller/default.py why is not the controller called? -- --
Re: [web2py] should re remove crud from the book?
I like crud very much (it's almost tallking english to the server) crud.read crud.update, ... it's like a web2py classic. For me, sounds like your preferred pizza delivery is not selling pepperoni anymore El sábado, 22 de diciembre de 2012 16:57:34 UTC-3, Massimo Di Pierro escribió: I am going over the book with grep. The problems are these: 1) crud checks permission, SQLFORM does not. 2) crud is used in welcome 3) in chapter 13 we say plugins can rely on crud. --
[web2py] Re: Small form on all pages..
Ok I had messed up some of my code, now everything works fine! Thanks anyway! --
Re: [web2py] Re: controller not returning variables
On Saturday, December 22, 2012 5:00:52 PM UTC-5, jonas wrote: Ok, I have a {{include}} statement in the beginning of the layout.html file that cals index.html and the corresponding index.py controller. And that one returns variables. So there is no way to call sidebar.py with tve corresponding view to get the variables? That's not quite how it works. Views do not call controllers. Rather, when a URL is requested, web2py routes the request to a particular controller. Once the controller returns, then the view is executed. So, your browser calls /myapp/default/index. web2py receives that request, and after executing your model files, it runs the index() function in the default.py controller. After the index() function returns, it then executes the /views/default/index.html view (with the keys/values of the dict returned by the index() function being available as variables within the view). Your index.html view then extends the layout.html view, which means its code gets inserted in place of the {{include}} within layout.html. So, the {{include}} in layout.html is not calling index.html, and index.html is not calling the index() function -- the order is the exact opposite -- the index() function is called first, then the index.html view is executed, and finally the index.html view extends layout.html. Anthony --
[web2py] Re: The book updates and status
El viernes, 21 de diciembre de 2012 03:50:54 UTC-3, Massimo Di Pierro escribió: Thanks this is great. One thing that can save you time is diff the current trunk version of the boot with first github commit. The first commit may still have bugs but less likely since it was already the published 4th edition. What about the 4th edition translations to other languages that are still in progress? Should we discard those and start with the new version? Could we use diff for this task too? --
Re: [web2py] Re: controller not returning variables
ok. thanks, that clarified the a few things. On Saturday, December 22, 2012 10:48:35 PM UTC, Anthony wrote: On Saturday, December 22, 2012 5:00:52 PM UTC-5, jonas wrote: Ok, I have a {{include}} statement in the beginning of the layout.html file that cals index.html and the corresponding index.py controller. And that one returns variables. So there is no way to call sidebar.py with tve corresponding view to get the variables? That's not quite how it works. Views do not call controllers. Rather, when a URL is requested, web2py routes the request to a particular controller. Once the controller returns, then the view is executed. So, your browser calls /myapp/default/index. web2py receives that request, and after executing your model files, it runs the index() function in the default.py controller. After the index() function returns, it then executes the /views/default/index.html view (with the keys/values of the dict returned by the index() function being available as variables within the view). Your index.html view then extends the layout.html view, which means its code gets inserted in place of the {{include}} within layout.html. So, the {{include}} in layout.html is not calling index.html, and index.html is not calling the index() function -- the order is the exact opposite -- the index() function is called first, then the index.html view is executed, and finally the index.html view extends layout.html. Anthony --
[web2py] Re: The book updates and status
The font used on the online version is much more 'friendly', and computer oriented. Versus the printed font, which reminds me formal law letters... I'm not sure about the better computer orientedness of the online version over the roman font of the pdf. Also, Serif typography is said to be better for long documents (I mean for long reading sessions). --
[web2py] Re: The book updates and status
The pdf/printed book style is based on this: http://code.google.com/p/tufte-latex/ Massimo On Saturday, 22 December 2012 17:40:20 UTC-6, Kostas M wrote: Ok, I will try to show what I mean, since these things it is kind of personal choice, and I am not a dtp designer, but still... I have attached two views (pdf book, and on-line) of the same page of the documentation. My comments are: - The Header and sub-header of the online version consume less space, and are more discernible at the same time. Many times as I am searching for a specific sub-header in the printed book, I miss to locate its place quickly. The printed sub-headers try to denote their presence by the use of *italics*, which usually are meant to distinct special words. In the online version, subheaders are much more distinguishable, through much *larger font**, and the use of bold*. - The font used on the online version is much more 'friendly', and computer oriented. Versus the printed font, which reminds me formal law letters... - The space around the code examples in the online version is bigger, giving 'breathing space' to the eye. Note also that the code has more space horizontally (among the letters), which resembles more the real console input view. Compare for instance the -i 127.0.01 -p 8000 between the printed and online versions. I hope I made my point clear.. --
[web2py] Re: Cron every 5 seconds.
Duplicated https://groups.google.com/d/topic/web2py/eiEImsH_ZVg/discussion --
[web2py] calendar.js incompatible with moment.js
We've found that the popular date library moment.js fails on date parsing when used alongside the calendar.js file included by default with web2py projects. I've submitted a bug report: http://code.google.com/p/web2py/issues/detail?id=1243 We removed calendar.js from our projects, but I'm unclear as to what it's there for? Where is it used, and why is it included by default? Is there a reason web2py doesn't use jquery's datepicker instead? --
Re: [web2py] calendar.js incompatible with moment.js
Celendar.js license is ok with web2py and it supports date, time or date and time. On Sun, Dec 23, 2012 at 12:41 AM, Yarin ykess...@gmail.com wrote: We've found that the popular date library moment.js fails on date parsing when used alongside the calendar.js file included by default with web2py projects. I've submitted a bug report: http://code.google.com/p/web2py/issues/detail?id=1243 We removed calendar.js from our projects, but I'm unclear as to what it's there for? Where is it used, and why is it included by default? Is there a reason web2py doesn't use jquery's datepicker instead? -- --
[web2py] Re: new feature in trunk, for teachers mostly
How can I setup EMAIL_SERVER to use gmail? default is: EMAIL_SERVER = 'localhost' and what is the meaning of EMAIL_LOGIN = None ? Thanks in advance :) 2012 m. kovas 27 d., antradienis 06:32:31 UTC+3, Massimo Di Pierro rašė: edit applications/admin/models/0.py and set MULTI_USER_MODE = True then register and login in the admin. The first user to login is the teacher. You will see two new buttons manage students and bulk register. You can use the bulk register page to give accounts to all your students. They can create projects and see only their projects. You see them all. Every time they edit/delete a file, web2py keeps track of the number of functional lines that have been added-removed. When you click on the about page for a project of one of your students you see a progress chart that shows how the added lines over time. X is time (negative, in days until today) and Y is lines (not including empty lines and # comments). Please help me test it and suggest improvements. Massimo --
[web2py] Re: help testing auth.signature with mysql/pgsql
What happens if you add the field, set it to True,then add the notnull constraint? --
[web2py] Re: calendar.js incompatible with moment.js
Do you get any error in the chrome console? On Saturday, 22 December 2012 20:41:43 UTC-6, Yarin wrote: We've found that the popular date library moment.js fails on date parsing when used alongside the calendar.js file included by default with web2py projects. I've submitted a bug report: http://code.google.com/p/web2py/issues/detail?id=1243 We removed calendar.js from our projects, but I'm unclear as to what it's there for? Where is it used, and why is it included by default? Is there a reason web2py doesn't use jquery's datepicker instead? --
[web2py] Re: new feature in trunk, for teachers mostly
Yes mail.settings.sender = 'smtp.gmail.com' mail.settings.login = 'y...@gmail.com:password' On Saturday, 22 December 2012 20:52:04 UTC-6, Jurgis Pralgauskis wrote: How can I setup EMAIL_SERVER to use gmail? default is: EMAIL_SERVER = 'localhost' and what is the meaning of EMAIL_LOGIN = None ? Thanks in advance :) 2012 m. kovas 27 d., antradienis 06:32:31 UTC+3, Massimo Di Pierro rašė: edit applications/admin/models/0.py and set MULTI_USER_MODE = True then register and login in the admin. The first user to login is the teacher. You will see two new buttons manage students and bulk register. You can use the bulk register page to give accounts to all your students. They can create projects and see only their projects. You see them all. Every time they edit/delete a file, web2py keeps track of the number of functional lines that have been added-removed. When you click on the about page for a project of one of your students you see a progress chart that shows how the added lines over time. X is time (negative, in days until today) and Y is lines (not including empty lines and # comments). Please help me test it and suggest improvements. Massimo --
[web2py] Re: help testing auth.signature with mysql/pgsql
The problem is that adding notnull constraint causes a migration (except on sqlite). Because the field exists already web2py creates a new tmp field, than tried to move existing data over. But the data contains Null while the new field is notnull=True therefore the migration will fail. On Saturday, 22 December 2012 21:12:54 UTC-6, Cliff Kachinske wrote: What happens if you add the field, set it to True,then add the notnull constraint? --
[web2py] Re: Remote access appadmin
I started up a brand new install of the latest stable web2py on my laptop: Version 2.3.2 (2012-12-17 15:03:30) stable Running on my home network @ 192.168.1.68:8000 I can open Safari on my iphone and enter: http://192.168.1.68:8000 and get the welcome screen for Web2py.If I press the administrative interface I get the message: Admin is disabled because insecure channel. Which is fine, but when I try: https://192.168.1.68:8000 I get a safari error message: Cannot Open Page Safari cannot open the page because it could not establish a secure connection to the server. Okay, so how do I create the required certificates and install them on web2py and the iphone? --
[web2py] Re: Remote access appadmin
Follow up to step 4 http://www.akadia.com/services/ssh_test_certificate.html Then you will have the server.crt and server.key files. Run web2py -h for instructions on how to use them. Massimo On Saturday, 22 December 2012 22:02:27 UTC-6, Rufus wrote: I started up a brand new install of the latest stable web2py on my laptop: Version 2.3.2 (2012-12-17 15:03:30) stable Running on my home network @ 192.168.1.68:8000 I can open Safari on my iphone and enter: http://192.168.1.68:8000 and get the welcome screen for Web2py.If I press the administrative interface I get the message: Admin is disabled because insecure channel. Which is fine, but when I try: https://192.168.1.68:8000 I get a safari error message: Cannot Open Page Safari cannot open the page because it could not establish a secure connection to the server. Okay, so how do I create the required certificates and install them on web2py and the iphone? --
[web2py] Re: raspberry pi
I've had two RPIs for several months. My first task was to install Web2py and our app on it (Apache, MySQL and 90 tables etc.) and it worked fine. I used an 8Gb SD card. It wasn't lightning fast, but as a potential test/demo environment it worked fine. Paul. On Tuesday, 13 March 2012 10:04:40 UTC, Ramos wrote: it would be nice to be able to install web2py in raspberry pi http://www.raspberrypi.org/ --
Re: [web2py] Re: calendar.js incompatible with moment.js
Not errors, just incorrect results- fails to parse dates, and returns isValid() false when testing valid date strings- see my bug report for a reproducable example- On Sat, Dec 22, 2012 at 10:27 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Do you get any error in the chrome console? On Saturday, 22 December 2012 20:41:43 UTC-6, Yarin wrote: We've found that the popular date library moment.js fails on date parsing when used alongside the calendar.js file included by default with web2py projects. I've submitted a bug report: http://code.google.com/p/**web2py/issues/detail?id=1243http://code.google.com/p/web2py/issues/detail?id=1243 We removed calendar.js from our projects, but I'm unclear as to what it's there for? Where is it used, and why is it included by default? Is there a reason web2py doesn't use jquery's datepicker instead? -- --