[web2py] app about page
hello. what does it mean the graph in the about page under Project progress? Thank you António --
Re: [web2py] Re: error in mysql ?
I try to translate... Seems that the new line is referencing a non existent article_category element. As far as I understand the table is a self referencing table. article_category.parent_id - article_category.id parent_id has a value that is not equal to any id of article_category mic 2013/1/4 Massimo Di Pierro massimo.dipie...@gmail.com What is the cause that causes this? On Thursday, 3 January 2013 19:30:53 UTC-6, samuel bonilla wrote: this is the error class '_mysql_exceptions.**IntegrityError' (1452, 'Cannot add or update a child row: a foreign key constraint fails (`samuel$otra`.`article_ **category`, CONSTRAINT `article_category_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `article_category` (`id`) ON DELETE CASCADE)') help me please -- --
[web2py] Re: nothing happens after custom form submission
Hi all, I got the solution. I changed the def myregister() function into def register(). Its working fine now. Previously it wasn't working, and the only thing I did new was just doing a clean from admin site menu. There is no point in clearing your browser history or restarting your shell. The clean helped me a lot. To howesc, you can use the normal form tag and close it using {{form.custom.end}}. This is helpful when you have lot of customization in your form especially with css. And you get the hidden form fields generated automatically using the form.custom.end. On Friday, 4 January 2013 06:17:44 UTC+5:30, Anthony wrote: form.custom.end is what includes the hidden fields, and that has been included in the code. Anthony On Thursday, January 3, 2013 6:59:20 PM UTC-5, howesc wrote: i don't see a {{=form.custom.begin}} in your view. this is required to output the hidden fields that web2py uses to validate the form submission. On Wednesday, January 2, 2013 8:03:47 AM UTC-8, ajith c t wrote: This is my form and controller function. My problem is nothing happens (redirection) after the register button is clicked. def myregister(): select all roles greater than 1. root is always 1 print in myregister form = auth.register(next='index') print form.vars return dict(form = form) the above is my custom myregister() function. {{extend 'layout.html'}} h1This is the default/myregister.html template/h1 form action= enctype=multipart/form-data method=post class=form-horizontal username: {{=form.custom.widget.username}} email: {{=form.custom.widget.email}} password: {{=form.custom.widget.password}} confirm password: {{=form.custom.widget.password_two}} account_id: {{=form.custom.widget.account_id}} role_id: {{=form.custom.widget.role_id}} {{=form.custom.submit}} {{=form.custom.end}} {{pass}} above code is my custom register view myregister.html i am using auth_user table after adding extra fields: auth.settings.extra_fields['auth_user']= [ Field('account_id', 'integer', notnull=True), # (`account_id` int(11) NOT NULL,) Field('organisation_id', 'integer'), # (`organisation_id` int(11) DEFAULT '0',) Field('role_id', 'integer', notnull=True, requires = IS_IN_SET([(2, 'admin'), (3, 'merchant'), (4, 'guest')])), # (`role_id` int(11) NOT NULL DEFAULT '0',) Field('username', 'string'), # (`username` varchar(64) COLLATE utf8_bin DEFAULT NULL,) Field('telephone', 'string'), # (`telephone` varchar(16) COLLATE utf8_bin DEFAULT NULL,) Field('mobile', 'string'), # (`mobile` varchar(16) COLLATE utf8_bin DEFAULT NULL,) Field('gender', 'string'), # (`gender` char(1) COLLATE utf8_bin DEFAULT NULL,) Field('about', 'text'),# (`about` text COLLATE utf8_bin,) Field('addr_1', 'string'), # (`addr_1` varchar(128) COLLATE utf8_bin DEFAULT NULL,) Field('addr_2', 'string'), # (`addr_2` varchar(128) COLLATE utf8_bin DEFAULT NULL,) Field('addr_3', 'string'), # (`addr_3` varchar(128) COLLATE utf8_bin DEFAULT NULL,) Field('city', 'string'), # (`city` varchar(64) COLLATE utf8_bin DEFAULT NULL,) Field('region', 'string'), # (`region` varchar(32) COLLATE utf8_bin DEFAULT NULL,) Field('country', 'string'),# (`country` char(2) COLLATE utf8_bin DEFAULT NULL,) Field('post_code', 'string'), # (`post_code` varchar(16) COLLATE utf8_bin DEFAULT NULL,) Field('is_email_public', 'integer'), # (`is_email_public` smallint(6) DEFAULT NULL,) Field('is_acct_active', 'integer'),# (`is_acct_active` smallint(6) DEFAULT NULL,) Field('security_question', 'integer'), # (`security_question` smallint(6) DEFAULT NULL,) Field('security_answer', 'string'),# (`security_answer` varchar(128) COLLATE utf8_bin DEFAULT NULL,) Field('date_created', 'datetime'), # (`date_created` datetime DEFAULT NULL,) Field('created_by', 'integer'),# (`created_by` int(11) DEFAULT NULL,) Field('last_updated', 'datetime'), # (`last_updated` datetime DEFAULT NULL,) Field('updated_by', 'integer') ] auth.settings.registration_requires_verification = False auth.settings.registration_requires_approval = False auth.settings.reset_password_requires_verification = True auth.settings.login_after_registration = True auth.settings.create_user_groups = False def onaccept(form): # form accepted auth.add_membership(form.vars.role_id, form.vars.id) auth.settings.register_onaccept.append(onaccept) I dont know what is going wrong. I have gone through similar questions in this forum but could solve this.
[web2py] Re: REF: Change order of fields in a form??!
SQLFORM takes a fields argument, which can be a list of field names to include in the order you want them. Anthony On Friday, January 4, 2013 2:22:51 AM UTC-5, software.ted wrote: How do you change the order of the form after it has been created using: form = SQLFORM(db.table) Also how do you change the font of the web2py editor??? -- ... Teddy Lubasi Nyambe Opensource Zambia Lusaka, ZAMBIA Cell: +260 97 7760473 website: http://www.opensource.org.zm ~/ Human Knowledge belongs to the world! - AntiTrust Man is a tool-using animal. Without tools he is nothing, with tools he is all - Thomas Carlyle 1795-1881 /~ --
[web2py] pulsar
http://packages.python.org/pulsar/overview.html --
Re: [web2py] pulsar
Is this like nodejs? 2013/1/4 Massimo Di Pierro massimo.dipie...@gmail.com http://packages.python.org/pulsar/overview.html -- --
Re: [web2py] pulsar
Interesting. Would be useful to also compare it with other similar—or subset covering—functionality frameworks such as: - Tornado http://www.tornadoweb.org/ - Twisted Matrix http://twistedmatrix.com/trac/ Or any of these frameworks: http://wiki.python.org/moin/Concurrency#Frameworks On Sat, Jan 5, 2013 at 1:21 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: http://packages.python.org/pulsar/overview.html -- --
[web2py] Putting apps together
I have an idea to write several applications or modules and put them together. For example a central authentication app and a maintenance app. Should I do severals apps or programming modules? How would you do this? --
Re: [web2py] pulsar
yep. Benchmarks apart, if reacts in an evented way could be the only thing working like that in Windows natively (a user a while ago posted in this list a repackage of tornado called motor that worked very well too. Sadly, not really largely supported). I'm curious about the implications of running with multiprocessing in Windows, I'd bet that is available only on Linux (thanks to the fork() availability). But if this will be adopted by some percentage of peoples well, I'll definitely look into that. Il giorno venerdì 4 gennaio 2013 15:31:07 UTC+1, Alec Taylor ha scritto: Interesting. Would be useful to also compare it with other similar—or subset covering—functionality frameworks such as: - Tornado http://www.tornadoweb.org/ - Twisted Matrix http://twistedmatrix.com/trac/ Or any of these frameworks: http://wiki.python.org/moin/Concurrency#Frameworks On Sat, Jan 5, 2013 at 1:21 AM, Massimo Di Pierro massimo@gmail.comjavascript: wrote: http://packages.python.org/pulsar/overview.html -- --
[web2py] Re: session[id]
Hi Derek, It seems to me that you are storing data in the session which should actually be linked to the auth_user table. No, this has nothing to do with Auth, it's about a node drive application, with data needed in every view stored in session. Kind regards, Annet --
[web2py] Chapter 8.1.2: Example PGP Encryption doees not work
Hi, I have tried the example from the book chapter 8.1.2 from gpgme import pgp mail.settings.cipher_type = 'gpg' mail.settings.sign = True mail.settings.sign_passphrase = 'your passphrase' mail.settings.encrypt = True I have tried different things: import gpgme import pyme No errors! But from gpgme import pgp always gives an error. What is wrong? The book says: The latter requires the python pyme package Is this all right? pyme or gpgme ? Regards, Martin --
Re: [web2py] Update codemirror to V3 on admin
Thanks! I'll see this ASAP. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Fri, Jan 4, 2013 at 4:18 AM, Roberto Perdomo roberto...@gmail.com wrote: Is a good idea, i see that Mariano edited the file ajax_editor.js, is a great idea integrate this to mi changes. Mariano, I open a ticket: http://code.google.com/p/web2py/issues/detail?id=1256 I fix the highlight, the search, replace and matchbrackets. 2013/1/3 Massimo Di Pierro massimo.dipie...@gmail.com I'd be happy to incude this when the debugger issue is fixed. Can you and Mariano work together to fix this problem? On Thursday, 3 January 2013 19:01:48 UTC-6, Roberto Perdomo wrote: 2013/1/3 Mariano Reingart rein...@gmail.com On Thu, Jan 3, 2013 at 5:54 AM, Roberto Perdomo rober...@gmail.com wrote: Hi, I have changed the edit.html from admin to get work codemirror 3. In some changes, I include closetag.js to autocomplete html tags and works fine. Please check if all works fine and consider the update. PS: the zip contains the new codemirror (need some clean files) Please post this on web2py-developers (or even better, open a ticket in the bug tracker): https://groups.google.com/forum/?fromgroups#!forum/web2py-developers Ready, thanks. Did you check the toggle breakpoint (debugger) functionality? (either using the button or also clicking over the line number) it uses gutter marker API that has changed between versions. Yes, and doenst work, make the page dont load anymore (need restart web2py ) Line highlight (i.e. saving a file on syntax errors) also seems not working properly (it selects from the offending line to the end of the 5file...). ummm, yes you are correct, I not see that. I've experienced some other CodeMirror bugs (like not repainting when scrolling with the mouse wheel), but those are less reproduce-able. Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com -- -- -- --
[web2py] Re: Chapter 8.1.2: Example PGP Encryption doees not work
according to gluon/tools.py code, the only imports done are from pyme import core, errors from pyme.constants.sig import mode Il giorno venerdì 4 gennaio 2013 17:10:27 UTC+1, mweissen ha scritto: Hi, I have tried the example from the book chapter 8.1.2 from gpgme import pgp mail.settings.cipher_type = 'gpg' mail.settings.sign = True mail.settings.sign_passphrase = 'your passphrase' mail.settings.encrypt = True I have tried different things: import gpgme import pyme No errors! But from gpgme import pgp always gives an error. What is wrong? The book says: The latter requires the python pyme package Is this all right? pyme or gpgme ? Regards, Martin --
[web2py] for code snippets
Hae a look at : http://codestagram.com/ --
Re: [web2py] pulsar
a while ago I saw vert.x (it is on top of jvm) , now that, and a question raised in my mind: why do I need nodejs or evented frameworks, if importing gevent and monkey patching makes everything non blocking? celery and other goods are already in web2py frameworks, so what are your thoughts? --
Re: [web2py] pulsar
because for really exploiting evented frameworks you need to code evented-ly also your app. Programming languages (also big frameworks like e.g. twisted) that by default have strong support for actors, events, light threads, and so on (and also for that reason, generally harder to grasp-create-maintain-adopt) are a level up if confronted with python+gevent monkeypatching, because all code in apps and modules and libraries is tailored to that kind of programming style (and requirements). Having wsgi frameworks that run in the evented way is the first step - really nice one, but still one - down to the rabbit hole.they solve the issue and the shortcomings of communicating with the outside, but your code needs to be refactored if you want to step up a level. Il giorno venerdì 4 gennaio 2013 17:38:55 UTC+1, Vasile Ermicioi ha scritto: a while ago I saw vert.x (it is on top of jvm) , now that, and a question raised in my mind: why do I need nodejs or evented frameworks, if importing gevent and monkey patching makes everything non blocking? celery and other goods are already in web2py frameworks, so what are your thoughts? --
[web2py] Possible bug: DAL csv import unable to parse csv file near ): syntax error BUT NO ) in thefile
Dear web2py, I am working my way thru the ajax-live-search-auto-complete web2pyslice. Instead of using inserts, i thought i'd use csv to populate the db. When i upload, I get an error flash that says: unable to parse csv file near ): syntax error BUT THERE'S NO ) right parenthesis in the csv. Is this a bug? Here's the model: db.define_table('country', Field('iso'), Field('name'), Field('printable_name'), Field('iso3'), Field('numcode')) Here's the csv: 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' This all looks OK to me. Thanks for the help in advance. Love and peace, Joe --
[web2py] Re: Possible bug: DAL csv import unable to parse csv file near ): syntax error BUT NO ) in thefile
i am using Version 2.3.2 (2012-12-17 15:03:30) stable sorry for no mentioning that before. Love and peace, Joe On Friday, January 4, 2013 9:14:53 AM UTC-8, JoeCodeswell wrote: Dear web2py, I am working my way thru the ajax-live-search-auto-complete web2pyslice. Instead of using inserts, i thought i'd use csv to populate the db. When i upload, I get an error flash that says: unable to parse csv file near ): syntax error BUT THERE'S NO ) right parenthesis in the csv. Is this a bug? Here's the model: db.define_table('country', Field('iso'), Field('name'), Field('printable_name'), Field('iso3'), Field('numcode')) Here's the csv: 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' This all looks OK to me. Thanks for the help in advance. Love and peace, Joe --
Re: [web2py] pulsar
thank you for your thoughts, may be there are scenarios where evented frameworks shine, but nodejs is a web framework, so in this scenario the main advantage is that requests don't block each other, so my question is regarding only this scenario: what advantage of using nodejs over gevent monkey patching for building websites? any examples? On Fri, Jan 4, 2013 at 7:01 PM, Niphlod niph...@gmail.com wrote: because for really exploiting evented frameworks you need to code evented-ly also your app. Programming languages (also big frameworks like e.g. twisted) that by default have strong support for actors, events, light threads, and so on (and also for that reason, generally harder to grasp-create-maintain-adopt) are a level up if confronted with python+gevent monkeypatching, because all code in apps and modules and libraries is tailored to that kind of programming style (and requirements). Having wsgi frameworks that run in the evented way is the first step - really nice one, but still one - down to the rabbit hole.they solve the issue and the shortcomings of communicating with the outside, but your code needs to be refactored if you want to step up a level. Il giorno venerdì 4 gennaio 2013 17:38:55 UTC+1, Vasile Ermicioi ha scritto: a while ago I saw vert.x (it is on top of jvm) , now that, and a question raised in my mind: why do I need nodejs or evented frameworks, if importing gevent and monkey patching makes everything non blocking? celery and other goods are already in web2py frameworks, so what are your thoughts? -- --
[web2py] Re: Possible bug: DAL csv import unable to parse csv file near ): syntax error BUT NO ) in thefile
You need to have the column names in the first line of the csv. On Friday, January 4, 2013 10:30:08 AM UTC-7, JoeCodeswell wrote: i am using Version 2.3.2 (2012-12-17 15:03:30) stable sorry for no mentioning that before. Love and peace, Joe On Friday, January 4, 2013 9:14:53 AM UTC-8, JoeCodeswell wrote: Dear web2py, I am working my way thru the ajax-live-search-auto-complete web2pyslice. Instead of using inserts, i thought i'd use csv to populate the db. When i upload, I get an error flash that says: unable to parse csv file near ): syntax error BUT THERE'S NO ) right parenthesis in the csv. Is this a bug? Here's the model: db.define_table('country', Field('iso'), Field('name'), Field('printable_name'), Field('iso3'), Field('numcode')) Here's the csv: 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' This all looks OK to me. Thanks for the help in advance. Love and peace, Joe --
[web2py] Re: Possible bug: DAL csv import unable to parse csv file near ): syntax error BUT NO ) in thefile
Hi Derek, Thanks for the reply. I just tried these 2 csv's: 'iso','name','printable_name','iso3','numcode' 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' RESULT: unable to parse csv file near ): syntax error AND iso,name,printable_name,iso3,numcode UY,URUGUAY,Uruguay,URY,858 UZ,UZBEKISTAN,Uzbekistan,UZB,860 VU,VANUATU,Vanuatu,VUT,548 VE,VENEZUELA,Venezuela,VEN,862 VN,VIET NAM,Viet Nam,VNM,704 VG,VIRGIN ISLANDS, BRITISH,Virgin Islands, British,VGB,092 VI,VIRGIN ISLANDS, U.S.,Virgin Islands, U.s.,VIR,850 WF,WALLIS AND FUTUNA,Wallis and Futuna,WLF,876 EH,WESTERN SAHARA,Western Sahara,ESH,732 YE,YEMEN,Yemen,YEM,887 ZM,ZAMBIA,Zambia,ZMB,894 ZW,ZIMBABWE,Zimbabwe,ZWE,716 RESULT: data uploaded Thanks for the help, Derek. Love and peace, Joe On Friday, January 4, 2013 11:17:41 AM UTC-8, Derek wrote: You need to have the column names in the first line of the csv. On Friday, January 4, 2013 10:30:08 AM UTC-7, JoeCodeswell wrote: i am using Version 2.3.2 (2012-12-17 15:03:30) stable sorry for no mentioning that before. Love and peace, Joe On Friday, January 4, 2013 9:14:53 AM UTC-8, JoeCodeswell wrote: Dear web2py, I am working my way thru the ajax-live-search-auto-complete web2pyslice. Instead of using inserts, i thought i'd use csv to populate the db. When i upload, I get an error flash that says: unable to parse csv file near ): syntax error BUT THERE'S NO ) right parenthesis in the csv. Is this a bug? Here's the model: db.define_table('country', Field('iso'), Field('name'), Field('printable_name'), Field('iso3'), Field('numcode')) Here's the csv: 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' This all looks OK to me. Thanks for the help in advance. Love and peace, Joe --
[web2py] Re: app about page
You are talking about this? http://fluxodecaixa.com.br/ On Friday, January 4, 2013 3:36:28 AM UTC-7, Ramos wrote: hello. what does it mean the graph in the about page under Project progress? Thank you António --
[web2py] web2py don't create or update tables and fields
I have a weird problem with web2py. It can't create or update tables in MySql. Although I'm using auth.define_tables(username=False, signature=False). I only need to refresh my web browser for changes take effect, right? What am I doing wrong? Thank you. --
[web2py] Re: web2py reference documentation
You can look at this Epydoc: http://www.web2py.com/examples/static/epydoc/index.html On Friday, January 4, 2013 1:37:03 PM UTC-7, rh wrote: Hello, I have downloaded all ~100 MBs of the docs locally and can browse them fine. (although I only wanted the latest english docs I got multiple versions and languages) But what's missing for me is the reference docs. Do they exist? Not sure if calling them an API reference is correct but something like that is what I'm looking for. --
[web2py] RuntimeError: Using a recursive select but encountered a broken reference: auth_group
I've an app, I register and user and it's ok. I have 1 instance running with python web2py.py at port 8080 (for admin console) ... and I have my httpd.conf configured with WSGI. Both work correctly, but when I try to login in the normal instance (at port 80), I get an error RuntimeError: Using a recursive select but encountered a broken reference: auth_group 1. If I try to do it at port 8080 all works good. --
Re: [web2py] pulsar
nodejs vs gevent+monkey_patching allows you to USE EV (please bear with me, from now on EV means just a programming pattern - google for that): apis, websockets, streaming, etc. usually are the best fit for that. Everything that needs either: - a lot of concurrent connections - a lot of opened connections streaming data usually works better with EV. That being said, my point was barely that having your traditional app running on gevent might not be as fast as a traditional nodejs app..and that's just because traditional in python doesn't - normally - mean EV patterns, while node (javascript, to be fair) forces you to use that kind of patterns (and so ALL libraries, modules, etc are optimized/engineered to exploit all the possibilities of EV). Running python code engineered to be EV in the first place coupled with gevent might be as fast as a nodejs app, but really, my point is *not* a matter on what framework gives you the most speed (I'd bet an Erlang app trumps nodejs). It's just stating that evented webservers in python are a nice thing to have because without changing a single line of your normal code many things are improved in speed terms (running on pypy, e.g. it's another simple step to look to), but if you want to match performances of other tools more targeted to that job, your app code needs to change a lot too. On Friday, January 4, 2013 7:37:26 PM UTC+1, Vasile Ermicioi wrote: thank you for your thoughts, may be there are scenarios where evented frameworks shine, but nodejs is a web framework, so in this scenario the main advantage is that requests don't block each other, so my question is regarding only this scenario: what advantage of using nodejs over gevent monkey patching for building websites? any examples? On Fri, Jan 4, 2013 at 7:01 PM, Niphlod nip...@gmail.com javascript:wrote: because for really exploiting evented frameworks you need to code evented-ly also your app. Programming languages (also big frameworks like e.g. twisted) that by default have strong support for actors, events, light threads, and so on (and also for that reason, generally harder to grasp-create-maintain-adopt) are a level up if confronted with python+gevent monkeypatching, because all code in apps and modules and libraries is tailored to that kind of programming style (and requirements). Having wsgi frameworks that run in the evented way is the first step - really nice one, but still one - down to the rabbit hole.they solve the issue and the shortcomings of communicating with the outside, but your code needs to be refactored if you want to step up a level. Il giorno venerdì 4 gennaio 2013 17:38:55 UTC+1, Vasile Ermicioi ha scritto: a while ago I saw vert.x (it is on top of jvm) , now that, and a question raised in my mind: why do I need nodejs or evented frameworks, if importing gevent and monkey patching makes everything non blocking? celery and other goods are already in web2py frameworks, so what are your thoughts? -- --
[web2py] Re: error in mysql ?
I'm developing an application based in movuca (https://github.com/rochacbruno/Movuca) with sqlite works fine, but when I use mysql generates this error .. I'm doing something wrong? El jueves, 3 de enero de 2013 20:30:53 UTC-5, samuel bonilla escribió: this is the error class '_mysql_exceptions.IntegrityError' (1452, 'Cannot add or update a child row: a foreign key constraint fails (`samuel$otra`.`article_category`, CONSTRAINT `article_category_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `article_category` (`id`) ON DELETE CASCADE)') help me please --
[web2py] SQLFORM.grid Error, changes from 2.2.1 to 2.3.1 - 2.3.2
Hi, In all my webapps I'm working with SQLFORM.grid, and testing with the new versions I got this error: type 'exceptions.TypeError' must be string, not listVERSIÓNweb2py™(2, 3, 2, datetime.datetime(2012, 12, 17, 15, 3, 30), 'stable')PythonPython 2.7.3: C:\Python27\python.exeTRACEBACK 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Traceback (most recent call last): File C:\Users\cespinoza\web2py-2.3.2\gluon\restricted.py, line 212, in restricted exec ccode in environment File C:/Users/cespinoza/web2py-2.3.2/applications/avl/controllers/reports.py http://127.0.0.1/admin/default/edit/avl/controllers/reports.py, line 359, in module File C:\Users\cespinoza\web2py-2.3.2\gluon\globals.py, line 193, in lambda self._caller = lambda f: f() File C:/Users/cespinoza/web2py-2.3.2/applications/avl/controllers/reports.py http://127.0.0.1/admin/default/edit/avl/controllers/reports.py, line 214, in events fecha_inicio = datetime.datetime.strptime(session.fecha_inicio,%d-%m-%Y) TypeError: must be string, not list I Noticed that the pagination links now have added some get vars, maybe are colliding with my vars, I'm using session vars in order to get a right behavior with it, but with the new versions it doesn't work... Thanks Christian. --
Re: [web2py] Re: error in mysql ?
sqlite has no runtime referencial integrity checks, hence you don't get the error. Mysql points out that there is a referential integrity issue in the database. 2013/1/4 samuel bonilla pythonn...@gmail.com I'm developing an application based in movuca ( https://github.com/rochacbruno/Movuca) with sqlite works fine, but when I use mysql generates this error .. I'm doing something wrong? El jueves, 3 de enero de 2013 20:30:53 UTC-5, samuel bonilla escribió: this is the error class '_mysql_exceptions.**IntegrityError' (1452, 'Cannot add or update a child row: a foreign key constraint fails (`samuel$otra`.`article_ **category`, CONSTRAINT `article_category_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `article_category` (`id`) ON DELETE CASCADE)') help me please -- --
[web2py] Customizing select options in crud.create forms
I have a set of models defined as follows: db.define_table('company', Field('name'), Field('symbol'), Field('approved', 'boolean')) db.define_table('locomotive', Field('manufacturer'), Field('model'), Field('approved', 'boolean'), db.define_table('engine', Field('company', db.company), Field('locomotive', db.locomotive)) The intent of the 'approved' fields are to limit what is displayed to the user in form select lists until they have been approved by someone with an admin role. I am attempting to limit the options in my engine controller create.crud function to only make available the companies and locomotives that are approved. I can obviously get this information easily using db(db.company.approved == True).select() etc. However, I am trying how to figure out how to get this filtered list of options into the select list dropdown in the crud.create(db.engine) form. Any suggestions? I tried to create a custom form to do the same thing, but it began to get really 'clunky'. Thanks in advance for any help! Dave --
[web2py] Re: upload from Edit page
Thanks for the link for multiple attachments. But I am not trying to implement multiple attachments here. Just single attachment from the edit page. On Sunday, December 30, 2012 1:09:59 PM UTC-8, Alan Etkin wrote: I suspect you're trying to give a multi-file upload in-the-same-page solution as Google and other brands do: AFAIK the standard upload widget cannot handle multiple submissions in one form, but you could implement your own widget with the help of this thread: https://groups.google.com/d/topic/web2py/XpnUb2_MaRc/discussion --
[web2py] Re: error in mysql ?
I can do to fix this problem ? El jueves, 3 de enero de 2013 20:30:53 UTC-5, samuel bonilla escribió: this is the error class '_mysql_exceptions.IntegrityError' (1452, 'Cannot add or update a child row: a foreign key constraint fails (`samuel$otra`.`article_category`, CONSTRAINT `article_category_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `article_category` (`id`) ON DELETE CASCADE)') help me please --
Re: [web2py] Re: error in mysql ?
Possible solutions: 1. Probably Bruno Rocha can help you better, so you can try to post a issue on github. 2. You can find what is the parent_id you are trying to insert then create an appropriate record with the needed id. 3. In case you don't have anything of value in the database just clean drop the mysql database and create a new one. 2013/1/4 samuel bonilla pythonn...@gmail.com I can do to fix this problem ? El jueves, 3 de enero de 2013 20:30:53 UTC-5, samuel bonilla escribió: this is the error class '_mysql_exceptions.**IntegrityError' (1452, 'Cannot add or update a child row: a foreign key constraint fails (`samuel$otra`.`article_ **category`, CONSTRAINT `article_category_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `article_category` (`id`) ON DELETE CASCADE)') help me please -- --
[web2py] Re: SQLFORM.grid Error, changes from 2.2.1 to 2.3.1 - 2.3.2
El viernes, 4 de enero de 2013 19:23:35 UTC-3, Christian Espinoza escribió: Hi, In all my webapps I'm working with SQLFORM.grid, and testing with the new versions I got this error: For debugging, perhaps it would be of help if you could post the relevant part of the app that builds the session variable fecha_inicio and provide more info on the environment (i.e. db engine and operating system) --
[web2py] Re: GAE + Cloud SQL: Tickets
El jueves, 3 de enero de 2013 11:31:45 UTC-3, Felipe Meirelles escribió: Well, the problem is when the ticket is saved, self.db points to DAL uri=google:sql://**:novello-solutionworkshop:novello-solutionworkshop/novello_test but when load() is called, it points to DAL uri=gae. AFAIK admin is db less. It uses the db of the app it manages. Besides, wasn't admin disabled for GAE? --
Re: [web2py] Re: error in mysql ?
but wouldn't his 'requires=' catch this before it even gets to the db? On Friday, January 4, 2013 3:51:30 PM UTC-7, Michele Comitini wrote: Possible solutions: 1. Probably Bruno Rocha can help you better, so you can try to post a issue on github. 2. You can find what is the parent_id you are trying to insert then create an appropriate record with the needed id. 3. In case you don't have anything of value in the database just clean drop the mysql database and create a new one. 2013/1/4 samuel bonilla pytho...@gmail.com javascript: I can do to fix this problem ? El jueves, 3 de enero de 2013 20:30:53 UTC-5, samuel bonilla escribió: this is the error class '_mysql_exceptions.**IntegrityError' (1452, 'Cannot add or update a child row: a foreign key constraint fails (`samuel$otra`.`article_ **category`, CONSTRAINT `article_category_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `article_category` (`id`) ON DELETE CASCADE)') help me please -- --
[web2py] Re: error when logging in using site domain
I have the same problem, do you have resolved it? Thanks. On Wednesday, January 2, 2013 7:38:47 PM UTC-6, dr_eeves wrote: Hi, I have been developing a web application using web2py. Most of the development has been done using the included development text editor (which has been great to use!). I'm required to use https when using the Administrative interface through my hosting provider. I get around this for now by using an ssh tunnel that allows me to connect through local host on my computer. When I log into my site with this setup (ssh tunnel), I have no problems using the site. However, when I try to log in through my site's domain directly, I get the following error: RuntimeError: Using a recursive select but encountered a broken reference : auth_group 1 I am not sure what is different been the two access methods which would cause such an error. Does anyone have any idea how to fix this issue? Thanks, Darryl --
[web2py] Re: Returning a token for Android app authentication
Would it be necessary to connect to the same web2py session? To my understanding, connecting to the same session would be necessary if the session contained Auth information indicating whether or not a user was logged in. However, using auth.login_bare(), I only return a token on login success, and the Auth information is never stored in session. Only the token would be used to check whether or not a user was authenticated, as this info is not stored in session. The login/authentication from Android would only be used for API calls, and not for browsing the site. In the 'tokens' table, there would be information about the user that would be similar to the Auth info stored in session. When the token is passed to web2py, it would return the same information that would normally be stored in session about the user. Thanks again for your help and checking my logic, I'm still pretty new to this! On Thursday, January 3, 2013 7:57:45 PM UTC-8, dlypka wrote: But are you reconnecting to the same web2py session on each request? On Thursday, January 3, 2013 3:20:01 PM UTC-6, Mark Li wrote: I reviewed your code again and looked into the source code for web2py to see how web2py deals with session login cookies. For what I want to accomplish, I believe I have found a method which does not involved changing web2py source code. It's simpler and more straight forward for me to wrap my head around (also not having to worry about storing cookies in the app). Please let me know if there's anything important I am missing or security flaws that I should consider. 1. Embed webview into native Android app, using auth.login_bare to authenticate. 2. On login success, return a token of similar format to web2py's session cookies. 3. Store this token in the database (in a table named 'tokens'), and send back to Android app as a cookie 4. For every request to my web service that requires authentication, send the token as a cookie and have the receiving API controller function extract the cookie/token. If the token is currently in the db.tokens, then the user has been authenticated and the request returns the appropriate data. 5. On logout/password change, delete the issued tokens for this user from db.tokens, so the same token can't be used to authenticate for future api calls. On Tuesday, January 1, 2013 10:33:26 PM UTC-8, dlypka wrote: I was not precisely calling from a native Android or native IOS app. I was using a PhoneGap client, which is different. It is looks like a web browser but is not a browser client. PhoneGap can only use HTML5 storage unless you write a native Android / IOS PhoneGap extension/plugin. So my technique will work from almost any client platform, even from a Windows native client app for example as long as it uses HTTP. Also, in my tracing of how web2py handles the client connection, I believe I found a few wrinkles in the sequence of events which needed to be handled specially in this case where the client is not a web browser. In your particular case, if you have cookies in the native client, then that is one less problem to solve, You probably just have to mimic the HTTP messages that a browser would send. On Tuesday, January 1, 2013 5:19:50 PM UTC-6, Mark Li wrote: Thanks for the responses, and Happy New Years to you guys too! dlypka, for your cookieless solution, it assumes that the client app can't store/extract tokens? In the Google Android link above, it says that both Android and iOS can read and extract the tokens/cookies. So when the Android app calls the Web2py app, wouldn't it just pass in the cookie/token and have Web2py verify it as it Web2py normally verifies session login cookies? On Tuesday, January 1, 2013 9:07:16 AM UTC-8, Massimo Di Pierro wrote: :-) On Tuesday, 1 January 2013 10:45:47 UTC-6, dlypka wrote: Yes it is my New Year's Resolution to make time to put it in a Slice. On Tuesday, January 1, 2013 10:35:49 AM UTC-6, Massimo Di Pierro wrote: Perhaps this should go in a web2pyslice? On Monday, 31 December 2012 21:28:04 UTC-6, dlypka wrote: I developed a solution for this. I posted it here: https://groups.google.com/forum/?fromgroups=#!topic/web2py/YVYQHRJmcos Happy New Year! On Monday, December 31, 2012 4:38:40 PM UTC-6, Mark Li wrote: I am currently trying to authenticate users on an Android app to my Web2py application. I am not comfortable implementing this on my own without some guidance/advice, as I'm worried about the security of the login information becoming jeopardized. I am following the guideline for authentication outlined by Google here: https://developers.google.com/accounts/docs/MobileApps Another outline of what how I'm trying to accomplish Authentication outlined here: http://stackoverflow.com/questions/7358715/authentication-model-for-android-application The first step, and my question, is how I would generate a
[web2py] Re: Customizing select options in crud.create forms
db.engine.company.requires = IS_IN_DB(db(db.company.approved == True),'company.id','%(name)s') On Thursday, 3 January 2013 23:36:18 UTC-6, Dave Cenker wrote: I have a set of models defined as follows: db.define_table('company', Field('name'), Field('symbol'), Field('approved', 'boolean')) db.define_table('locomotive', Field('manufacturer'), Field('model'), Field('approved', 'boolean'), db.define_table('engine', Field('company', db.company), Field('locomotive', db.locomotive)) The intent of the 'approved' fields are to limit what is displayed to the user in form select lists until they have been approved by someone with an admin role. I am attempting to limit the options in my engine controller create.crud function to only make available the companies and locomotives that are approved. I can obviously get this information easily using db(db.company.approved == True).select() etc. However, I am trying how to figure out how to get this filtered list of options into the select list dropdown in the crud.create(db.engine) form. Any suggestions? I tried to create a custom form to do the same thing, but it began to get really 'clunky'. Thanks in advance for any help! Dave --
[web2py] Re: Uploading images
yes row.update(avatar=db.tablename.avatar.store(request.post_vars['upload_field' ],filename='yourname.ext')) On Friday, 4 January 2013 00:36:31 UTC-6, Wonton wrote: Hello Massimo! I bypass the form.proccess because this is a web service used by an iOS app. I do all frontend stuff in iOS and call this web service from the device. And regarding to change the name of the file, is it possible? kind regards! El viernes, 4 de enero de 2013 04:11:16 UTC+1, Massimo Di Pierro escribió: You can do row.update(avatar=db.tablename.avatar.store(request.post_vars[ 'upload_field'])) by why bypess form.process()? it does it for you. On Thursday, 3 January 2013 15:57:24 UTC-6, Wonton wrote: Hello! I'm trying to implement uploading user's avatar. I've tried to follow the image blog example from the book and some of the posts related to this issue in this forum and I'm still a bit confused and I don't know if I could do certain things or how to do them. What I would like to achieve is this: -Upload the avatar and store it in the file system. The link to the file will be stored in the database. As far as I know this is possible with Field('avatar', 'upload'). But, my first doubt: could I store the image file with a custom name, for example auth_user.username.jpg? I see that the file has a strange name when it's stored. -I would like the image to be public, anyone could see that image in any browser through its link. But, my second doubt: the content of the avatar field in my database is a File, and when I go to that link I see the content of the file in the URL and don't see the image. Finally, my last doubt, in my web service I access the image data through request.post_vars. If I print this data I get something like this: Storage {'upload_field': FieldStorage('upload_field', 'myphoto_1.jpg', '\xff\xd8\ ... ... ...\x04\xd9')} I guess I have to store the image in the database with this: row.update(avatar=request.post_vars['upload_field']) Am I right? Thank you very much! --
[web2py] Re: Putting apps together
All apps are already CAS providers and consumers. Perhaps this helps: http://web2py.com/books/default/chapter/29/09#Central-Authentication-Service On Friday, 4 January 2013 09:14:34 UTC-6, Sverre wrote: I have an idea to write several applications or modules and put them together. For example a central authentication app and a maintenance app. Should I do severals apps or programming modules? How would you do this? --
[web2py] Re: Possible bug: DAL csv import unable to parse csv file near ): syntax error BUT NO ) in thefile
What's the difference between the two? On Friday, 4 January 2013 13:36:25 UTC-6, JoeCodeswell wrote: Hi Derek, Thanks for the reply. I just tried these 2 csv's: 'iso','name','printable_name','iso3','numcode' 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' RESULT: unable to parse csv file near ): syntax error AND iso,name,printable_name,iso3,numcode UY,URUGUAY,Uruguay,URY,858 UZ,UZBEKISTAN,Uzbekistan,UZB,860 VU,VANUATU,Vanuatu,VUT,548 VE,VENEZUELA,Venezuela,VEN,862 VN,VIET NAM,Viet Nam,VNM,704 VG,VIRGIN ISLANDS, BRITISH,Virgin Islands, British,VGB,092 VI,VIRGIN ISLANDS, U.S.,Virgin Islands, U.s.,VIR,850 WF,WALLIS AND FUTUNA,Wallis and Futuna,WLF,876 EH,WESTERN SAHARA,Western Sahara,ESH,732 YE,YEMEN,Yemen,YEM,887 ZM,ZAMBIA,Zambia,ZMB,894 ZW,ZIMBABWE,Zimbabwe,ZWE,716 RESULT: data uploaded Thanks for the help, Derek. Love and peace, Joe On Friday, January 4, 2013 11:17:41 AM UTC-8, Derek wrote: You need to have the column names in the first line of the csv. On Friday, January 4, 2013 10:30:08 AM UTC-7, JoeCodeswell wrote: i am using Version 2.3.2 (2012-12-17 15:03:30) stable sorry for no mentioning that before. Love and peace, Joe On Friday, January 4, 2013 9:14:53 AM UTC-8, JoeCodeswell wrote: Dear web2py, I am working my way thru the ajax-live-search-auto-complete web2pyslice. Instead of using inserts, i thought i'd use csv to populate the db. When i upload, I get an error flash that says: unable to parse csv file near ): syntax error BUT THERE'S NO ) right parenthesis in the csv. Is this a bug? Here's the model: db.define_table('country', Field('iso'), Field('name'), Field('printable_name'), Field('iso3'), Field('numcode')) Here's the csv: 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' This all looks OK to me. Thanks for the help in advance. Love and peace, Joe --
[web2py] Re: app about page
It counts the lines of lines in the code (.html and .py files only). I use it to monitor when my students work on projects. On Friday, 4 January 2013 04:36:28 UTC-6, Ramos wrote: hello. what does it mean the graph in the about page under Project progress? Thank you António --
[web2py] Re: RuntimeError: Using a recursive select but encountered a broken reference: auth_group
Looking into this... On Friday, 4 January 2013 15:53:05 UTC-6, Ignacio Ocampo wrote: I've an app, I register and user and it's ok. I have 1 instance running with python web2py.py at port 8080 (for admin console) ... and I have my httpd.conf configured with WSGI. Both work correctly, but when I try to login in the normal instance (at port 80), I get an error RuntimeError: Using a recursive select but encountered a broken reference: auth_group 1. If I try to do it at port 8080 all works good. --
Re: [web2py] pulsar
They say it runs on windows. If this is written in pure python could be used as a portable solution to tornado for websockets. On Friday, 4 January 2013 16:18:31 UTC-6, Niphlod wrote: nodejs vs gevent+monkey_patching allows you to USE EV (please bear with me, from now on EV means just a programming pattern - google for that): apis, websockets, streaming, etc. usually are the best fit for that. Everything that needs either: - a lot of concurrent connections - a lot of opened connections streaming data usually works better with EV. That being said, my point was barely that having your traditional app running on gevent might not be as fast as a traditional nodejs app..and that's just because traditional in python doesn't - normally - mean EV patterns, while node (javascript, to be fair) forces you to use that kind of patterns (and so ALL libraries, modules, etc are optimized/engineered to exploit all the possibilities of EV). Running python code engineered to be EV in the first place coupled with gevent might be as fast as a nodejs app, but really, my point is *not* a matter on what framework gives you the most speed (I'd bet an Erlang app trumps nodejs). It's just stating that evented webservers in python are a nice thing to have because without changing a single line of your normal code many things are improved in speed terms (running on pypy, e.g. it's another simple step to look to), but if you want to match performances of other tools more targeted to that job, your app code needs to change a lot too. On Friday, January 4, 2013 7:37:26 PM UTC+1, Vasile Ermicioi wrote: thank you for your thoughts, may be there are scenarios where evented frameworks shine, but nodejs is a web framework, so in this scenario the main advantage is that requests don't block each other, so my question is regarding only this scenario: what advantage of using nodejs over gevent monkey patching for building websites? any examples? On Fri, Jan 4, 2013 at 7:01 PM, Niphlod nip...@gmail.com wrote: because for really exploiting evented frameworks you need to code evented-ly also your app. Programming languages (also big frameworks like e.g. twisted) that by default have strong support for actors, events, light threads, and so on (and also for that reason, generally harder to grasp-create-maintain-adopt) are a level up if confronted with python+gevent monkeypatching, because all code in apps and modules and libraries is tailored to that kind of programming style (and requirements). Having wsgi frameworks that run in the evented way is the first step - really nice one, but still one - down to the rabbit hole.they solve the issue and the shortcomings of communicating with the outside, but your code needs to be refactored if you want to step up a level. Il giorno venerdì 4 gennaio 2013 17:38:55 UTC+1, Vasile Ermicioi ha scritto: a while ago I saw vert.x (it is on top of jvm) , now that, and a question raised in my mind: why do I need nodejs or evented frameworks, if importing gevent and monkey patching makes everything non blocking? celery and other goods are already in web2py frameworks, so what are your thoughts? -- --
[web2py] Re: GAE + Cloud SQL: Tickets
Admin is readonly on GAE and by default not deployed. On Friday, 4 January 2013 17:10:56 UTC-6, Alan Etkin wrote: El jueves, 3 de enero de 2013 11:31:45 UTC-3, Felipe Meirelles escribió: Well, the problem is when the ticket is saved, self.db points to DAL uri=google:sql://**:novello-solutionworkshop:novello-solutionworkshop/novello_test but when load() is called, it points to DAL uri=gae. AFAIK admin is db less. It uses the db of the app it manages. Besides, wasn't admin disabled for GAE? --
[web2py] Re: drop table cascade
drop('cascade') seems not working. On Wednesday, 4 February 2009 14:17:14 UTC+8, mdipierro wrote: give this a try. In trunk db.table.drop('cascade') On Feb 3, 11:40 pm, Baron richar...@gmail.com wrote: thanks Massimo. On Feb 4, 3:28 pm, mdipierro mdipie...@cs.depaul.edu wrote: sorry, for now you have to do it manually db.executesql('DROP TABLE tablename CASCADE;') perhaps I can add an option to drop/truncate. Massimo On Feb 3, 9:01 pm, Baron richar...@gmail.com wrote: When I try to drop or truncate a table I get this error: ProgrammingError: cannot drop table dump because other objects depend on it HINT: Use DROP ... CASCADE to drop the dependent objects too. Deleting from the table works fine because the deletions cascade. Is there a way to truncate or drop tables through the DAL that have foreign key dependencies? Baron --
[web2py] How to import file within another directory of modules
Hi all, In my modules directory, I created a new directory named users and create a python file test_users.py within users directory. The structure is like this: *my_application/modules/users/test_users.py* I know that files within modules directory can be imported simply by *import filename.py *statement but how to import this one. I have tried import models/users.py but it gives me following error: Encountered / at line 22, column 14. Was expecting one of: NEWLINE ... ; ... , ... . ... as ... ; --
Re: [web2py] Re: error in mysql ?
I have no idea where the error happens. If it is not a in form submission requires is not considered... 2013/1/5 Derek sp1d...@gmail.com but wouldn't his 'requires=' catch this before it even gets to the db? On Friday, January 4, 2013 3:51:30 PM UTC-7, Michele Comitini wrote: Possible solutions: 1. Probably Bruno Rocha can help you better, so you can try to post a issue on github. 2. You can find what is the parent_id you are trying to insert then create an appropriate record with the needed id. 3. In case you don't have anything of value in the database just clean drop the mysql database and create a new one. 2013/1/4 samuel bonilla pytho...@gmail.com I can do to fix this problem ? El jueves, 3 de enero de 2013 20:30:53 UTC-5, samuel bonilla escribió: this is the error class '_mysql_exceptions.**IntegrityEr**ror' (1452, 'Cannot add or update a child row: a foreign key constraint fails (`samuel$otra`.`article_ **catego**ry`, CONSTRAINT `article_category_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `article_category` (`id`) ON DELETE CASCADE)') help me please -- -- --
[web2py] Re: RuntimeError: Using a recursive select but encountered a broken reference: auth_group
Massimo, Thank you, I found the solution. I have wrong RewriteCond and RewriteRule parameters at httpd.conf I have a domain.com working with Apache, and I configured an alias /myapp that works to web2py framework. The good configuration for this case is. VirtualHost *:80 DocumentRoot /var/www/html ServerName www.domain.com ServerAlias domain.com *.domain.com Directory /var/www/html Options FollowSymLinks AllowOverride All /Directory *RewriteEngine On* *RewriteCond %{REQUEST_URI} ^/**myapp**.* [NC]* *RewriteRule ^/(.*) /myapp/$1 [PT,L]* *WSGIScriptAlias /**myapp** /opt/web2py/wsgihandler.py* /VirtualHost Best regards. On Friday, January 4, 2013 6:55:30 PM UTC-6, Massimo Di Pierro wrote: Looking into this... On Friday, 4 January 2013 15:53:05 UTC-6, Ignacio Ocampo wrote: I've an app, I register and user and it's ok. I have 1 instance running with python web2py.py at port 8080 (for admin console) ... and I have my httpd.conf configured with WSGI. Both work correctly, but when I try to login in the normal instance (at port 80), I get an error RuntimeError: Using a recursive select but encountered a broken reference: auth_group 1. If I try to do it at port 8080 all works good. --
[web2py] Apache using 99% cpu, when web2py accessed using JQ-mobile - latest psycopyg2 used
I've posted the question on StackOverFlow too, but I thought this would be the correct place : http://stackoverflow.com/questions/14150481/web2py-premature-end-of-script-headers-wsgihandler-py-apache-eating-cpu-9 Here is the flow : 1.) User visits the default/index.html 2.) Accessing this index.html isn't a problem either 3.) When the data is shown on iphone in ListView and I click on an item, that is when suddenly the cpu spikes. When I click on an item, the controller function called getLinkPages is called. I've removed all code from this function which accesses the database, it simply returns hardcoded strings. Some more info. in case it helps : *OS* : Ubuntu 12.04 LTS *Memory* : 512 MB RAM *Web2py version* : Version 1.99.7 (2012-03-04 22:12:08) stable *psycopg2* version : 2.4.5 Here is the error shown in apache's error.log : Premature end of script headers: wsgihandler.py referrer http://sitename.com; Here is what I have in my file inside sites-available : VirtualHost *:80 ServerName xxx.xx ServerAlias www.xxx.in WSGIDaemonProcess web2py user=www-data group=www-data display-name=%{GROUP} processes=5 threads=1 WSGIProcessGroup web2py WSGIApplicationGroup %{GLOBAL} WSGIScriptAlias / /opt/xxx/webcontent/web2py/wsgihandler.py Directory /opt/xxx/webcontent/web2py AllowOverride None Order Allow,Deny Deny from all Files wsgihandler.py Allow from all /Files /Directory AliasMatch ^/([^/]+)/static/(.*) /opt/xxx/webcontent/web2py/applications/$1/static/$2 Directory /opt/xxx/webcontent/web2py/applications/*/static/ Order Allow,Deny Allow from all /Directory Location /admin Deny from all /Location LocationMatch ^/([^/]+)/appadmin Deny from all /LocationMatch CustomLog /var/log/apache2/access.log common ErrorLog /var/log/apache2/error.log /VirtualHost VirtualHost *:443 ServerName xxx.xxx ServerAlias www.xxx.xxx SSLEngine on SSLCertificateFile /etc/apache2/ssl/self_signed.cert SSLCertificateKeyFile /etc/apache2/ssl/self_signed.key WSGIProcessGroup web2py CustomLog /var/log/apache2/https-access.log common ErrorLog /var/log/apache2/https-error.log /VirtualHost I thought making *processes=5 threads=1* might at least alleviate the issue, since currently only I'm accessing it. Neither has -- *WSGIApplicationGroup %{GLOBAL}* - Am I doing something incorrect here while using JQuery mobile ? - Any other logs I can enable to dig deeper ? --
Re: [web2py] Re: error in mysql ?
Hi, I had a lot of problems like this when I was developing with sqlite, now my rule is develop from beginning with the final database what will run in production environment.. Christian. El viernes, 4 de enero de 2013 22:45:18 UTC-3, Michele Comitini escribió: I have no idea where the error happens. If it is not a in form submission requires is not considered... 2013/1/5 Derek sp1...@gmail.com javascript: but wouldn't his 'requires=' catch this before it even gets to the db? On Friday, January 4, 2013 3:51:30 PM UTC-7, Michele Comitini wrote: Possible solutions: 1. Probably Bruno Rocha can help you better, so you can try to post a issue on github. 2. You can find what is the parent_id you are trying to insert then create an appropriate record with the needed id. 3. In case you don't have anything of value in the database just clean drop the mysql database and create a new one. 2013/1/4 samuel bonilla pytho...@gmail.com I can do to fix this problem ? El jueves, 3 de enero de 2013 20:30:53 UTC-5, samuel bonilla escribió: this is the error class '_mysql_exceptions.**IntegrityEr**ror' (1452, 'Cannot add or update a child row: a foreign key constraint fails (`samuel$otra`.`article_ **catego**ry`, CONSTRAINT `article_category_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `article_category` (`id`) ON DELETE CASCADE)') help me please -- -- --
[web2py] Re: SQLFORM.grid Error, changes from 2.2.1 to 2.3.1 - 2.3.2
The issue appears on windows and linux, the db is mysql, I will rewrite my code for the new SQLFORM.grid in order to use the GET vars that are now on the new version ... Actually I'm doing all work with session vars in order to run the pagination of the grid... El viernes, 4 de enero de 2013 19:57:59 UTC-3, Alan Etkin escribió: El viernes, 4 de enero de 2013 19:23:35 UTC-3, Christian Espinoza escribió: Hi, In all my webapps I'm working with SQLFORM.grid, and testing with the new versions I got this error: For debugging, perhaps it would be of help if you could post the relevant part of the app that builds the session variable fecha_inicio and provide more info on the environment (i.e. db engine and operating system) --
[web2py] Re: error when logging in using site domain
Darry, I had the same problem, I post my solution at: http://nafiux.com/blog/2013/01/04/web2py-deploy-specific-app-with-apache-webserver/ In my case, the problem was caused by a bad RewriteRule configuration at my httpd.conf file. The correct configuration that I used is: VirtualHost *:80 DocumentRoot /var/www/html ServerName www.domain.com ServerAlias domain.com *.domain.com Directory /var/www/html Options FollowSymLinks AllowOverride All /Directory RewriteEngine On RewriteCond %{REQUEST_URI} ^/myapp.* [NC] RewriteRule ^/(.*) /myapp/$1 [PT,L] WSGIScriptAlias /myapp /opt/web2py/wsgihandler.py /VirtualHost Best regards. On Wednesday, January 2, 2013 7:38:47 PM UTC-6, dr_eeves wrote: Hi, I have been developing a web application using web2py. Most of the development has been done using the included development text editor (which has been great to use!). I'm required to use https when using the Administrative interface through my hosting provider. I get around this for now by using an ssh tunnel that allows me to connect through local host on my computer. When I log into my site with this setup (ssh tunnel), I have no problems using the site. However, when I try to log in through my site's domain directly, I get the following error: RuntimeError: Using a recursive select but encountered a broken reference : auth_group 1 I am not sure what is different been the two access methods which would cause such an error. Does anyone have any idea how to fix this issue? Thanks, Darryl --
[web2py] Re: REF: Change order of fields in a form??!
Is easy use a custom form instead of {{=form}}, then you can control where put your input fields... {{=form.custom.begin}} Image name: div{{=form.custom.widget.name}}/div Image file: div{{=form.custom.widget.file}}/div Click here to upload: {{=form.custom.submit}} {{=form.custom.end}} Reference: http://web2py.com/books/default/chapter/29/07#Custom-forms Christian. El viernes, 4 de enero de 2013 04:22:51 UTC-3, software.ted escribió: How do you change the order of the form after it has been created using: form = SQLFORM(db.table) Also how do you change the font of the web2py editor??? -- ... Teddy Lubasi Nyambe Opensource Zambia Lusaka, ZAMBIA Cell: +260 97 7760473 website: http://www.opensource.org.zm ~/ Human Knowledge belongs to the world! - AntiTrust Man is a tool-using animal. Without tools he is nothing, with tools he is all - Thomas Carlyle 1795-1881 /~ --
[web2py] Re: Possible bug: DAL csv import unable to parse csv file near ): syntax error BUT NO ) in thefile
Dear Massimo, You asked: What's the difference between the two? * * *Answer: * *Double quotes* on the one that *worked*. *Single quotes* on the one that *didn't work*. Love and peace, Joe On Friday, January 4, 2013 4:54:01 PM UTC-8, Massimo Di Pierro wrote: What's the difference between the two? On Friday, 4 January 2013 13:36:25 UTC-6, JoeCodeswell wrote: Hi Derek, Thanks for the reply. I just tried these 2 csv's: 'iso','name','printable_name','iso3','numcode' 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' RESULT: unable to parse csv file near ): syntax error AND iso,name,printable_name,iso3,numcode UY,URUGUAY,Uruguay,URY,858 UZ,UZBEKISTAN,Uzbekistan,UZB,860 VU,VANUATU,Vanuatu,VUT,548 VE,VENEZUELA,Venezuela,VEN,862 VN,VIET NAM,Viet Nam,VNM,704 VG,VIRGIN ISLANDS, BRITISH,Virgin Islands, British,VGB,092 VI,VIRGIN ISLANDS, U.S.,Virgin Islands, U.s.,VIR,850 WF,WALLIS AND FUTUNA,Wallis and Futuna,WLF,876 EH,WESTERN SAHARA,Western Sahara,ESH,732 YE,YEMEN,Yemen,YEM,887 ZM,ZAMBIA,Zambia,ZMB,894 ZW,ZIMBABWE,Zimbabwe,ZWE,716 RESULT: data uploaded Thanks for the help, Derek. Love and peace, Joe On Friday, January 4, 2013 11:17:41 AM UTC-8, Derek wrote: You need to have the column names in the first line of the csv. On Friday, January 4, 2013 10:30:08 AM UTC-7, JoeCodeswell wrote: i am using Version 2.3.2 (2012-12-17 15:03:30) stable sorry for no mentioning that before. Love and peace, Joe On Friday, January 4, 2013 9:14:53 AM UTC-8, JoeCodeswell wrote: Dear web2py, I am working my way thru the ajax-live-search-auto-complete web2pyslice. Instead of using inserts, i thought i'd use csv to populate the db. When i upload, I get an error flash that says: unable to parse csv file near ): syntax error BUT THERE'S NO ) right parenthesis in the csv. Is this a bug? Here's the model: db.define_table('country', Field('iso'), Field('name'), Field('printable_name'), Field('iso3'), Field('numcode')) Here's the csv: 'UY','URUGUAY','Uruguay','URY','858' 'UZ','UZBEKISTAN','Uzbekistan','UZB','860' 'VU','VANUATU','Vanuatu','VUT','548' 'VE','VENEZUELA','Venezuela','VEN','862' 'VN','VIET NAM','Viet Nam','VNM','704' 'VG','VIRGIN ISLANDS, BRITISH','Virgin Islands, British','VGB','092' 'VI','VIRGIN ISLANDS, U.S.','Virgin Islands, U.s.','VIR','850' 'WF','WALLIS AND FUTUNA','Wallis and Futuna','WLF','876' 'EH','WESTERN SAHARA','Western Sahara','ESH','732' 'YE','YEMEN','Yemen','YEM','887' 'ZM','ZAMBIA','Zambia','ZMB','894' 'ZW','ZIMBABWE','Zimbabwe','ZWE','716' This all looks OK to me. Thanks for the help in advance. Love and peace, Joe --
[web2py] Multiple File Upload
Is multi-file upload still roll-your-own, a la: https://groups.google.com/forum/?fromgroups=#!searchin/web2py/multiple$20file$20upload/web2py/XpnUb2_MaRc/DkUOi4iDrPYJ or is there something native, as per proposals: https://groups.google.com/forum/?fromgroups=#!searchin/web2py/multi$20upload/web2py/MenvVfNJCnU/ZQxfwPSX0SUJ ? It seems there's no web2py_slice on the topic. I'm thinking it's useful enough to be a feature. I'm looking at something jQuery-ish. This is slick enough for me, especially if it can be made it a component: https://github.com/blueimp/jQuery-File-Upload/wiki/Setup --
Re: [web2py] Re: REF: Change order of fields in a form??!
Thanks, what about the ide font in web2py how do u change it? On Jan 5, 2013 6:46 AM, Christian Espinoza chespin...@gmail.com wrote: Is easy use a custom form instead of {{=form}}, then you can control where put your input fields... {{=form.custom.begin}} Image name: div{{=form.custom.widget.name}}/div Image file: div{{=form.custom.widget.file}}/div Click here to upload: {{=form.custom.submit}} {{=form.custom.end}} Reference: http://web2py.com/books/default/chapter/29/07#Custom-forms Christian. El viernes, 4 de enero de 2013 04:22:51 UTC-3, software.ted escribió: How do you change the order of the form after it has been created using: form = SQLFORM(db.table) Also how do you change the font of the web2py editor??? -- ..**..** ... Teddy Lubasi Nyambe Opensource Zambia Lusaka, ZAMBIA Cell: +260 97 7760473 website: http://www.opensource.org.zm ~/ Human Knowledge belongs to the world! - AntiTrust Man is a tool-using animal. Without tools he is nothing, with tools he is all - Thomas Carlyle 1795-1881 /~ -- --
Re: [web2py] Re: REF: Change order of fields in a form??!
try changing font-style in web2py.css from web2py/applications/admin/static/codemirror/theme. Something like: .cm-s-web2py { line-height: 1.40em; font-family: sans-serif; /* set your font style here */ } 2013/1/5 Teddy Nyambe software@gmail.com Thanks, what about the ide font in web2py how do u change it? On Jan 5, 2013 6:46 AM, Christian Espinoza chespin...@gmail.com wrote: Is easy use a custom form instead of {{=form}}, then you can control where put your input fields... {{=form.custom.begin}} Image name: div{{=form.custom.widget.name}}/div Image file: div{{=form.custom.widget.file}}/div Click here to upload: {{=form.custom.submit}} {{=form.custom.end}} Reference: http://web2py.com/books/default/chapter/29/07#Custom-forms Christian. El viernes, 4 de enero de 2013 04:22:51 UTC-3, software.ted escribió: How do you change the order of the form after it has been created using: form = SQLFORM(db.table) Also how do you change the font of the web2py editor??? -- ..**..** ... Teddy Lubasi Nyambe Opensource Zambia Lusaka, ZAMBIA Cell: +260 97 7760473 website: http://www.opensource.org.zm ~/ Human Knowledge belongs to the world! - AntiTrust Man is a tool-using animal. Without tools he is nothing, with tools he is all - Thomas Carlyle 1795-1881 /~ -- -- --