[web2py] new version of printed book?
Hello! The end of the month is approaching and although we're busy doing some amanda backups in order to safely return back to (arch(linux, we're wondering what's with the new version of printed web2py book? Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 signature.asc Description: PGP signature
Re: [web2py] Re: Mobile detector
I tried: def mobile(): from gluon.contrib import user_agent_parser ua = user_agent_parser.detect(request.env.http_user_agent) if ua.dist.is_mobile: and i got: AttributeError: 'NoneType' object has no attribute 'is_mobile' Browsers: Opera 11.50, Safari 3.1.2 (1) What is wrong? (2) There have been a lot of proposals how to change every view from .html to .m.html if is_mobile is true. Now I am a little bit confused: what would be the best code following if ua.dist.is_mobile...? Regards, Martin 2011/8/28 Massimo Di Pierro massimo.dipie...@gmail.com I have no objection.What do others think? On Aug 28, 10:53 am, Angelo Compagnucci angelo.compagnu...@gmail.com wrote: HI Ross, Massimo, I wrote a small decorator to use the newly added is_mobile flag: class mobilize(object): def __init__(self, func): self.func = func def __call__(self): from gluon import current if current.session._user_agent: if current.session._user_agent.is_mobile: current.response.view = \ current.response.view.split(.)[0] + .mobi return self.func() It should be included at the bottom of user_agent_parser.py. With this you can have automatically selected the view.html or the view.mobi depending on your browser is mobile or not, an example could be: @mobilize def index(): example action using the mobilizer decorator it is rendered by views/default/index.html or views/default/index.mobi depending if your browser is mobile or not return dict(message=response.view) Could this be added in trunk? 2011/8/27 Massimo Di Pierro massimo.dipie...@gmail.com: This is in trunk as of last night. On Aug 26, 12:13 pm, Ross Peoples ross.peop...@gmail.com wrote: I submitted this to Massimo for inclusion. Now we wait :)
Re: [web2py] Re: testing scheduler in windows
Any directions to solve this issue? i´m installing another machine with windows 7 to try again. Em 24 de agosto de 2011 13:54, António Ramos ramstei...@gmail.comescreveu: s 2.6.5 32bits and Windows 7(64Bits)
Re: [web2py] is anybody using the new scheduler....
I tried, got an error and no one care. :( 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com ... does it work for you? Pros? Cons? Errors? Did you stress test it?
Re: [web2py] new version of printed book?
Also, the pdf version should be free for the ones that bought the first version, like me! :) 2011/8/29 Gour-Gadadhara Dasa g...@atmarama.net Hello! The end of the month is approaching and although we're busy doing some amanda backups in order to safely return back to (arch(linux, we're wondering what's with the new version of printed web2py book? Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
[web2py] off topic - Python tutorials
check this site,its free for viewing ! A lot of movie tutorials for python and other languages http://marakana.com/techtv/index.html
Re: [web2py] Re: Mobile detector
Hi Martin, In trunk the correct syntax should be: from gluon.contrib import user_agent_parser ua = user_agent_parser.detect(request.env.http_user_agent) if ua.is_mobile: ... Or better: ua = request.user_agent() if ua.is_mobile: ... The mothod user_agent() search in session if the user_agent was already parsed, so in the end it parses the user agent only first time. 2011/8/29 Martin Weissenboeck mweis...@gmail.com: I tried: def mobile(): from gluon.contrib import user_agent_parser ua = user_agent_parser.detect(request.env.http_user_agent) if ua.dist.is_mobile: and i got: AttributeError: 'NoneType' object has no attribute 'is_mobile' Browsers: Opera 11.50, Safari 3.1.2 (1) What is wrong? (2) There have been a lot of proposals how to change every view from .html to .m.html if is_mobile is true. Now I am a little bit confused: what would be the best code following if ua.dist.is_mobile...? Regards, Martin 2011/8/28 Massimo Di Pierro massimo.dipie...@gmail.com I have no objection.What do others think? On Aug 28, 10:53 am, Angelo Compagnucci angelo.compagnu...@gmail.com wrote: HI Ross, Massimo, I wrote a small decorator to use the newly added is_mobile flag: class mobilize(object): def __init__(self, func): self.func = func def __call__(self): from gluon import current if current.session._user_agent: if current.session._user_agent.is_mobile: current.response.view = \ current.response.view.split(.)[0] + .mobi return self.func() It should be included at the bottom of user_agent_parser.py. With this you can have automatically selected the view.html or the view.mobi depending on your browser is mobile or not, an example could be: @mobilize def index(): example action using the mobilizer decorator it is rendered by views/default/index.html or views/default/index.mobi depending if your browser is mobile or not return dict(message=response.view) Could this be added in trunk? 2011/8/27 Massimo Di Pierro massimo.dipie...@gmail.com: This is in trunk as of last night. On Aug 26, 12:13 pm, Ross Peoples ross.peop...@gmail.com wrote: I submitted this to Massimo for inclusion. Now we wait :)
[web2py] Re: Published my collection of plugins
Thanks for quick bug fixes Are you considering adding pagination? Peter On Aug 29, 5:16 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I would definitively want to see multiline records in SQLFORM.grid. Is anybody interested in doing this? Massimo On Aug 28, 11:06 pm, kenji4569 hos...@s-cubism.jp wrote: T I got some bug reports for the Solid Table, and fixed the bugs: OrderbySelector fails when current_orderby is nullhttps://github.com/kenji4569/sqlabs/issues/34 solidtable fails when headers='labels'https://github.com/kenji4569/sqlabs/issues/32 SOLID TABLE fails when columns=[[a,b],None,[c,d]]https://github.com/kenji4569/sqlabs/issues/37 Thanks for reporting them. On 8月28日, 午前2:27, kenji4569 hos...@s-cubism.jp wrote: Thank you all for your wonderful comments. Do you want to host and manage all plugins? Currently I doubt if I could commit this, though I want to contribute more as much as I could. I see you take time to make order in sqltable :O. Please subscribe to web2py-developers. I will subscribe to it. But first I need time to see how the development goes on. On 8月27日, 午後9:30, Bruno Rocha rochacbr...@gmail.com wrote: On Sat, Aug 27, 2011 at 8:01 AM, Martín Mulone mulone.mar...@gmail.comwrote: Bruno extracolumns are in SQLTABLE. really? LOL.. never knew about it.- Hide quoted text - - Show quoted text -
Re: [web2py] Re: Mobile detector
Hi Angelo, it works now, thanks! Any ideas about the second question? There have been a lot of proposals how to change every view from .html to .m.html if is_mobile is true. Now I am a little bit confused: what would be the best code following if ua.is_mobile...? 2011/8/29 Angelo Compagnucci angelo.compagnu...@gmail.com Hi Martin, In trunk the correct syntax should be: from gluon.contrib import user_agent_parser ua = user_agent_parser.detect(request.env.http_user_agent) if ua.is_mobile: ... Or better: ua = request.user_agent() if ua.is_mobile: ... The mothod user_agent() search in session if the user_agent was already parsed, so in the end it parses the user agent only first time. 2011/8/29 Martin Weissenboeck mweis...@gmail.com: I tried: def mobile(): from gluon.contrib import user_agent_parser ua = user_agent_parser.detect(request.env.http_user_agent) if ua.dist.is_mobile: and i got: AttributeError: 'NoneType' object has no attribute 'is_mobile' Browsers: Opera 11.50, Safari 3.1.2 (1) What is wrong? (2) There have been a lot of proposals how to change every view from .html to .m.html if is_mobile is true. Now I am a little bit confused: what would be the best code following if ua.dist.is_mobile...? Regards, Martin 2011/8/28 Massimo Di Pierro massimo.dipie...@gmail.com I have no objection.What do others think? On Aug 28, 10:53 am, Angelo Compagnucci angelo.compagnu...@gmail.com wrote: HI Ross, Massimo, I wrote a small decorator to use the newly added is_mobile flag: class mobilize(object): def __init__(self, func): self.func = func def __call__(self): from gluon import current if current.session._user_agent: if current.session._user_agent.is_mobile: current.response.view = \ current.response.view.split(.)[0] + .mobi return self.func() It should be included at the bottom of user_agent_parser.py. With this you can have automatically selected the view.html or the view.mobi depending on your browser is mobile or not, an example could be: @mobilize def index(): example action using the mobilizer decorator it is rendered by views/default/index.html or views/default/index.mobi depending if your browser is mobile or not return dict(message=response.view) Could this be added in trunk? 2011/8/27 Massimo Di Pierro massimo.dipie...@gmail.com: This is in trunk as of last night. On Aug 26, 12:13 pm, Ross Peoples ross.peop...@gmail.com wrote: I submitted this to Massimo for inclusion. Now we wait :)
[web2py] Current trunk on Linux
When I try running the current trunk on linux, I get the following error. (dp1 S'output' p2 S'' sS'layer' p3 S'Framework' p4 sS'code' p5 S'' sS'snapshot' p6 (dp7 sS'traceback' p8 S'Traceback (most recent call last):\n File /opt/web-apps/web2py/gluon/main.py, line 484, in wsgibase\n File /opt/web-apps/web2py/gluon/main.py, line 187, in serve_controller\n File /opt/web-apps/web2py/gluon/compileapp.py, line 230, in build_environment\n sys.modules[path] = module\n File /opt/web-apps/web2py/gluon/cache.py, line 363, in __init__\n --\n File /opt/web-apps/web2py/gluon/custom_import.py, line 279, in __call__\n modules_prefix = \\\n TypeError: super(type, obj): obj must be an instance or subtype of type \n' p9 s.
[web2py] Re: Current trunk on Linux
I just realised that I did not restart web2py. This solved the problem Peter On Aug 29, 10:58 am, peter peterchutchin...@gmail.com wrote: When I try running the current trunk on linux, I get the following error. (dp1 S'output' p2 S'' sS'layer' p3 S'Framework' p4 sS'code' p5 S'' sS'snapshot' p6 (dp7 sS'traceback' p8 S'Traceback (most recent call last):\n File /opt/web-apps/web2py/gluon/main.py, line 484, in wsgibase\n File /opt/web-apps/web2py/gluon/main.py, line 187, in serve_controller\n File /opt/web-apps/web2py/gluon/compileapp.py, line 230, in build_environment\n sys.modules[path] = module\n File /opt/web-apps/web2py/gluon/cache.py, line 363, in __init__\n --\n File /opt/web-apps/web2py/gluon/custom_import.py, line 279, in __call__\n modules_prefix = \\\n TypeError: super(type, obj): obj must be an instance or subtype of type \n' p9 s.
Re: [web2py] Re: Mobile detector
Hi Maritn, In trunk you can now do: #only at the top of you controller from gluon.contrib import user_agent_parser @mobilize def index(): example action using the mobilizer decorator it is rendered by views/default/index.html or views/default/index.mobi depending if your browser is mobile or not return dict(message=response.view) With this decorator, the index page is rendered by index.html if you are on a desktop browser and index.mobi if you are on a mobile browser. So to implement a sort of responsive design simply using the @mobilize decorator and writing your mobile custom views. The decorator is totally optional, so you can implement only the mobile version of pages you care. Angelo 2011/8/29 Martin Weissenboeck mweis...@gmail.com: Hi Angelo, it works now, thanks! Any ideas about the second question? There have been a lot of proposals how to change every view from .html to .m.html if is_mobile is true. Now I am a little bit confused: what would be the best code following if ua.is_mobile...? 2011/8/29 Angelo Compagnucci angelo.compagnu...@gmail.com Hi Martin, In trunk the correct syntax should be: from gluon.contrib import user_agent_parser ua = user_agent_parser.detect(request.env.http_user_agent) if ua.is_mobile: ... Or better: ua = request.user_agent() if ua.is_mobile: ... The mothod user_agent() search in session if the user_agent was already parsed, so in the end it parses the user agent only first time. 2011/8/29 Martin Weissenboeck mweis...@gmail.com: I tried: def mobile(): from gluon.contrib import user_agent_parser ua = user_agent_parser.detect(request.env.http_user_agent) if ua.dist.is_mobile: and i got: AttributeError: 'NoneType' object has no attribute 'is_mobile' Browsers: Opera 11.50, Safari 3.1.2 (1) What is wrong? (2) There have been a lot of proposals how to change every view from .html to .m.html if is_mobile is true. Now I am a little bit confused: what would be the best code following if ua.dist.is_mobile...? Regards, Martin 2011/8/28 Massimo Di Pierro massimo.dipie...@gmail.com I have no objection.What do others think? On Aug 28, 10:53 am, Angelo Compagnucci angelo.compagnu...@gmail.com wrote: HI Ross, Massimo, I wrote a small decorator to use the newly added is_mobile flag: class mobilize(object): def __init__(self, func): self.func = func def __call__(self): from gluon import current if current.session._user_agent: if current.session._user_agent.is_mobile: current.response.view = \ current.response.view.split(.)[0] + .mobi return self.func() It should be included at the bottom of user_agent_parser.py. With this you can have automatically selected the view.html or the view.mobi depending on your browser is mobile or not, an example could be: @mobilize def index(): example action using the mobilizer decorator it is rendered by views/default/index.html or views/default/index.mobi depending if your browser is mobile or not return dict(message=response.view) Could this be added in trunk? 2011/8/27 Massimo Di Pierro massimo.dipie...@gmail.com: This is in trunk as of last night. On Aug 26, 12:13 pm, Ross Peoples ross.peop...@gmail.com wrote: I submitted this to Massimo for inclusion. Now we wait :)
[web2py] Weird admin editing of views but ok on controllers
Just got a fresh clone from trunk. Am on Apache2+wsgi. When clicking the edit button of a view, I get the following at the browser resulting to a 404 Not Found. Notice the '%2F' which is supposed to be just '/'. https://.../admin/default/edit/welcome/views/default%2Findex.html When clicking the edit button of a controller, I get a correct URL at the browser. https://.../admin/default/edit/welcome/controllers/default.py Does anybody else getting this weird behaviour?
[web2py] Re: Lost with simple replace + db.select() result
On Sunday, August 28, 2011 11:29:05 PM UTC-4, pbreit wrote: row.update_record is going to actually modify the text in the database (if that's what you want). Note, you can do row.update() if you just want to modify the current row object _without_ changing the record in the database. Anthony
[web2py] Re: Weird admin editing of views but ok on controllers
Probably due to this recent fix: http://code.google.com/p/web2py/source/detail?r=c5f6a123b846d9c9c84e2ddbe21beb8691057dea On Monday, August 29, 2011 6:49:22 AM UTC-4, Noel Villamor wrote: Just got a fresh clone from trunk. Am on Apache2+wsgi. When clicking the edit button of a view, I get the following at the browser resulting to a 404 Not Found. Notice the '%2F' which is supposed to be just '/'. https://.../admin/default/edit/welcome/views/default%2Findex.html When clicking the edit button of a controller, I get a correct URL at the browser. https://.../admin/default/edit/welcome/controllers/default.py Does anybody else getting this weird behaviour?
[web2py] Re: Weird admin editing of views but ok on controllers
Hmmm ... I can verify this by reverting gluon/html.py to the 2011-08-25 version. What is the command for that in hg? Version 1.98.2 (2011-08-25 22:59:48) Version 1.98.2 (2011-08-26 07:44:22) Or perhaps I can just manually edit it. On Aug 29, 11:18 pm, Anthony abasta...@gmail.com wrote: Probably due to this recent fix:http://code.google.com/p/web2py/source/detail?r=c5f6a123b846d9c9c84e2... On Monday, August 29, 2011 6:49:22 AM UTC-4, Noel Villamor wrote: Just got a fresh clone from trunk. Am on Apache2+wsgi. When clicking the edit button of a view, I get the following at the browser resulting to a 404 Not Found. Notice the '%2F' which is supposed to be just '/'. https://.../admin/default/edit/welcome/views/default%2Findex.html When clicking the edit button of a controller, I get a correct URL at the browser. https://.../admin/default/edit/welcome/controllers/default.py Does anybody else getting this weird behaviour?
[web2py] Re: SQLFORM not handling hidden fields? Or do I have a bug?
Not sue that would help. The insert goes into purchase_orders, not supplier_contacts. On Aug 26, 4:16 pm, Anthony abasta...@gmail.com wrote: Does it work if you set db.supplier_contacts.supplier_id.writable = True in the controller function? On Friday, August 26, 2011 11:12:31 AM UTC-4, Cliff wrote: Massimo, Thank you. Of course. Here are are the real table defs: +++ ++ db.define_table('purchase_orders', Field('issue_date', 'date'), Field('number', length=24, requires=IS_NOT_EMPTY(), required=True, notnull=True, comment='Required'), Field('supplier', db.suppliers), Field('shipto', db.locations, label='Ship To'), Field('billto', db.locations, label='Bill To'), Field('del_terms', db.del_terms, label='Delivery Terms'), Field('currency', db.currencies), Field('pmt_terms', db.pmt_terms, label='Payment Terms'), Field('project_no', length=12, label='Project Number'), Field('taxable', 'list:string', default='No'), Field('po_contact', db.contacts, label='Purchase Order Contact'), Field('ap_contact', db.contacts, label='Accounts Payable Contact'), Field('vendor_rep', db.contacts, label='Vendor Representative'), Field('documentation_required', 'list:reference documentation', comment='Click to select. Use Ctrl key for multiple selection.') ) db.purchase_orders.taxable.requires = IS_IN_SET(['Yes', 'No']) db.purchase_orders.shipto.requires = IS_IN_DB(db, db.locations.id, '% (name)s', zero='Choice required') db.purchase_orders.billto.requires = IS_IN_DB(db, db.locations.id, '% (name)s', zero='Choice required') db.purchase_orders.supplier.requires = IS_IN_DB(db, db.suppliers.id, '% (name)s', zero='Choice required') db.purchase_orders.del_terms.requires = IS_IN_DB(db, db.del_terms.id, '%(name)s', zero='Choice required') db.purchase_orders.currency.requires = IS_IN_DB(db, db.currencies.id, '%(name)s', zero='Choice required') db.purchase_orders.pmt_terms.requires = IS_IN_DB(db, db.pmt_terms.id, '%(name)s', zero='Choice required') db.purchase_orders.po_contact.requires = IS_IN_DB( db(), db.contacts.id, '%(first_name)s, %(middle_name)s, % (last_name)s, %(generation)s ', zero='Choice required') db.purchase_orders.ap_contact.requires = IS_IN_DB( db(), db.contacts.id, '%(first_name)s', zero='Choice required') db.purchase_orders.vendor_rep.requires = IS_IN_DB( db(), db.supplier_contacts.id, '%(first_name)s', zero='Choice required') db.define_table('suppliers', Field('name', length=256, required=True, notnull=True), Field('address', length=64), Field('address_2', length=64), Field('city', length=32), Field('state', length=24), Field('zip', length=18), Field('website', length=512, requires=IS_URL()), format = '%(name)s' ) db.define_table( 'supplier_contacts', Field('supplier_id', db.suppliers), Field('first_name', length=32, required=True, notnull=True), Field('middle_name', length=32), Field('last_name', length=32, required=True, notnull=True), Field('generation', length=16), Field('email', length=512, requires=IS_EMPTY_OR(IS_EMAIL('invalid email'))), Field('mobile', length=18, label='Mobile phone'), Field('land_line', length=18), Field('fax', length=18), format='%(first_name)s, %(middle_name)s, %(last_name)s, % (generation)s' ) db.supplier_contacts.supplier_id.requires = IS_IN_DB( db, db.suppliers.id, '%(name)s', zero='Choose' ) db.supplier_contacts.supplier_id.readable = False db.supplier_contacts.supplier_id.writable = False +++ ++ This is the actual call from the controller: # we already know the supplier_id and vendor_rep hidden['supplier']=supplier_id hidden['vendor_rep'=vendor_rep field_lst = 'issue_date number shipto billto del_terms currency pmt_terms project_no taxable po_contact ap_contact documentation_required'.split(' ') form = SQLTABLE(db.suppliers, fields=field_lst, hidden=hidden) On Aug 26, 8:39 am, Massimo Di Pierro massimo@gmail.com wrote: Can I see the model? On Aug 26, 4:43 am, Cliff cjk...@gmail.com wrote: I use SQLFORM something like this: fields = 'dog_name dog_weight dog_birtdate'.split(' ') hidden = {'dog_owner' : some_known_value} # We already know who the owner is SQLFORM(db.dogs, fields=fields, hidden=hidden) The hidden fields are on the form. When I submit the form, they are in request.vars, but
[web2py] Re: testing scheduler in windows
Try start python and type: import platform On Aug 29, 3:43 am, António Ramos ramstei...@gmail.com wrote: Any directions to solve this issue? i´m installing another machine with windows 7 to try again. Em 24 de agosto de 2011 13:54, António Ramos ramstei...@gmail.comescreveu: s 2.6.5 32bits and Windows 7(64Bits)
[web2py] Re: new version of printed book?
It is although the process is manual. You email me you purchase receipt and I email you a link to the pdf book. On Aug 29, 3:47 am, António Ramos ramstei...@gmail.com wrote: Also, the pdf version should be free for the ones that bought the first version, like me! :) 2011/8/29 Gour-Gadadhara Dasa g...@atmarama.net Hello! The end of the month is approaching and although we're busy doing some amanda backups in order to safely return back to (arch(linux, we're wondering what's with the new version of printed web2py book? Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net| Hlapicina (Croatia) | GPG: 52B5C810
[web2py] Re: Published my collection of plugins
SQLFORM.grid(query) SQLFORM.smartgrid(table) are replacements for SQLTABLE and crud. they have search, pagination, sorting, and lots more. Give them a try. On Aug 29, 4:40 am, peter peterchutchin...@gmail.com wrote: Thanks for quick bug fixes Are you considering adding pagination? Peter On Aug 29, 5:16 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I would definitively want to see multiline records in SQLFORM.grid. Is anybody interested in doing this? Massimo On Aug 28, 11:06 pm, kenji4569 hos...@s-cubism.jp wrote: T I got some bug reports for the Solid Table, and fixed the bugs: OrderbySelector fails when current_orderby is nullhttps://github.com/kenji4569/sqlabs/issues/34 solidtable fails when headers='labels'https://github.com/kenji4569/sqlabs/issues/32 SOLID TABLE fails when columns=[[a,b],None,[c,d]]https://github.com/kenji4569/sqlabs/issues/37 Thanks for reporting them. On 8月28日, 午前2:27, kenji4569 hos...@s-cubism.jp wrote: Thank you all for your wonderful comments. Do you want to host and manage all plugins? Currently I doubt if I could commit this, though I want to contribute more as much as I could. I see you take time to make order in sqltable :O. Please subscribe to web2py-developers. I will subscribe to it. But first I need time to see how the development goes on. On 8月27日, 午後9:30, Bruno Rocha rochacbr...@gmail.com wrote: On Sat, Aug 27, 2011 at 8:01 AM, Martín Mulone mulone.mar...@gmail.comwrote: Bruno extracolumns are in SQLTABLE. really? LOL.. never knew about it.- Hide quoted text - - Show quoted text -
[web2py] Re: is anybody using the new scheduler....
Sorry Ramos. The problem is that your error is not in the scheduler. It is in import platform a standard Python module. Something is wrong with your version of Python. On Aug 29, 3:44 am, António Ramos ramstei...@gmail.com wrote: I tried, got an error and no one care. :( 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com ... does it work for you? Pros? Cons? Errors? Did you stress test it?
[web2py] Re: is anybody using the new scheduler....
which questions? On Aug 29, 5:06 am, Martín Mulone mulone.mar...@gmail.com wrote: I'm on it. For me is working really nice, but I have some questions. Also I'm working in a plugin to admin the scheduler.- 2011/8/29 António Ramos ramstei...@gmail.com I tried, got an error and no one care. :( 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com ... does it work for you? Pros? Cons? Errors? Did you stress test it? -- http://martin.tecnodoc.com.ar
[web2py] Re: Weird admin editing of views but ok on controllers
Anthony, your suspicion is confirmed. I reverted to the older gluon/ html.py and the '%2F' issue is gone. On Aug 29, 11:28 pm, Noel Villamor noe...@gmail.com wrote: Hmmm ... I can verify this by reverting gluon/html.py to the 2011-08-25 version. What is the command for that in hg? Version 1.98.2 (2011-08-25 22:59:48) Version 1.98.2 (2011-08-26 07:44:22) Or perhaps I can just manually edit it. On Aug 29, 11:18 pm, Anthony abasta...@gmail.com wrote: Probably due to this recent fix:http://code.google.com/p/web2py/source/detail?r=c5f6a123b846d9c9c84e2... On Monday, August 29, 2011 6:49:22 AM UTC-4, Noel Villamor wrote: Just got a fresh clone from trunk. Am on Apache2+wsgi. When clicking the edit button of a view, I get the following at the browser resulting to a 404 Not Found. Notice the '%2F' which is supposed to be just '/'. https://.../admin/default/edit/welcome/views/default%2Findex.html When clicking the edit button of a controller, I get a correct URL at the browser. https://.../admin/default/edit/welcome/controllers/default.py Does anybody else getting this weird behaviour?
[web2py] Re: Weird admin editing of views but ok on controllers
For now I have reverted that patch. It is backward incompatible and breaks things like this: URL('download',args='path/to/file') To the developers, let's discuss it on web2py-developers. massimo -- Forwarded message -- From: Anthony abasta...@gmail.com Date: Aug 29, 6:18 am Subject: Weird admin editing of views but ok on controllers To: web2py-users Probably due to this recent fix:http://code.google.com/p/web2py/source/detail? r=c5f6a123b846d9c9c84e2... On Monday, August 29, 2011 6:49:22 AM UTC-4, Noel Villamor wrote: Just got a fresh clone from trunk. Am on Apache2+wsgi. When clicking the edit button of a view, I get the following at the browser resulting to a 404 Not Found. Notice the '%2F' which is supposed to be just '/'. https://.../admin/default/edit/welcome/views/default%2Findex.html When clicking the edit button of a controller, I get a correct URL at the browser. https://.../admin/default/edit/welcome/controllers/default.py Does anybody else getting this weird behaviour?
[web2py] Re: new version of printed book?
On Mon, 29 Aug 2011 04:58:11 -0700 (PDT) Massimo Di Pierro massimo.dipie...@gmail.com wrote: It is although the process is manual. You email me you purchase receipt and I email you a link to the pdf book. I'd like to buy new printed edition and wonder when it will be available. Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 signature.asc Description: PGP signature
Re: [web2py] Re: is anybody using the new scheduler....
to use the trunk version Which version of python should i run in my pc? 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com Sorry Ramos. The problem is that your error is not in the scheduler. It is in import platform a standard Python module. Something is wrong with your version of Python. On Aug 29, 3:44 am, António Ramos ramstei...@gmail.com wrote: I tried, got an error and no one care. :( 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com ... does it work for you? Pros? Cons? Errors? Did you stress test it?
Re: [web2py] Re: testing scheduler in windows
no error importing platform! I have python2.5 and 2.6 32 bits 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com Try start python and type: import platform On Aug 29, 3:43 am, António Ramos ramstei...@gmail.com wrote: Any directions to solve this issue? i´m installing another machine with windows 7 to try again. Em 24 de agosto de 2011 13:54, António Ramos ramstei...@gmail.com escreveu: s 2.6.5 32bits and Windows 7(64Bits)
[web2py] Re: new version of printed book?
Hopefully by the end of september. On Aug 29, 7:28 am, Gour-Gadadhara Dasa g...@atmarama.net wrote: On Mon, 29 Aug 2011 04:58:11 -0700 (PDT) Massimo Di Pierro massimo.dipie...@gmail.com wrote: It is although the process is manual. You email me you purchase receipt and I email you a link to the pdf book. I'd like to buy new printed edition and wonder when it will be available. Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net| Hlapicina (Croatia) | GPG: 52B5C810 signature.asc 1KViewDownload
[web2py] Re: testing scheduler in windows
Can anybody else reproduce this error that Ramos is having on windows? http://web2py.googlegroups.com/attach/3a16ca7b8a2d7baa/Scheduler.jpg The error is clearly at import platform in the web2py code. Massimo On Aug 29, 8:35 am, António Ramos ramstei...@gmail.com wrote: no error importing platform! I have python2.5 and 2.6 32 bits 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com Try start python and type: import platform On Aug 29, 3:43 am, António Ramos ramstei...@gmail.com wrote: Any directions to solve this issue? i´m installing another machine with windows 7 to try again. Em 24 de agosto de 2011 13:54, António Ramos ramstei...@gmail.com escreveu: s 2.6.5 32bits and Windows 7(64Bits)
Re: [web2py] Re: is anybody using the new scheduler....
Can I suggest to pass a value to disable logging feature in the loop, I already have my own logging methods in the scripts, mixing is a really bad idea, and a headache. Also can't be customized. 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com which questions? On Aug 29, 5:06 am, Martín Mulone mulone.mar...@gmail.com wrote: I'm on it. For me is working really nice, but I have some questions. Also I'm working in a plugin to admin the scheduler.- 2011/8/29 António Ramos ramstei...@gmail.com I tried, got an error and no one care. :( 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com ... does it work for you? Pros? Cons? Errors? Did you stress test it? -- http://martin.tecnodoc.com.ar -- http://martin.tecnodoc.com.ar
[web2py] Re: SQLFORM not handling hidden fields? Or do I have a bug?
Cliff, please post the related dogs table model.
[web2py] Re: SQLFORM not handling hidden fields? Or do I have a bug?
Did you show the correct controller code? Your form is define as a SQLTABLE (rather than SQLFORM), and the table argument is db.suppliers, not db.purchase_orders. Anthony On Monday, August 29, 2011 7:33:25 AM UTC-4, Cliff wrote: Not sue that would help. The insert goes into purchase_orders, not supplier_contacts. On Aug 26, 4:16 pm, Anthony abas...@gmail.com wrote: Does it work if you set db.supplier_contacts.supplier_id.writable = True in the controller function? On Friday, August 26, 2011 11:12:31 AM UTC-4, Cliff wrote: Massimo, Thank you. Of course. Here are are the real table defs: +++ ++ db.define_table('purchase_orders', Field('issue_date', 'date'), Field('number', length=24, requires=IS_NOT_EMPTY(), required=True, notnull=True, comment='Required'), Field('supplier', db.suppliers), Field('shipto', db.locations, label='Ship To'), Field('billto', db.locations, label='Bill To'), Field('del_terms', db.del_terms, label='Delivery Terms'), Field('currency', db.currencies), Field('pmt_terms', db.pmt_terms, label='Payment Terms'), Field('project_no', length=12, label='Project Number'), Field('taxable', 'list:string', default='No'), Field('po_contact', db.contacts, label='Purchase Order Contact'), Field('ap_contact', db.contacts, label='Accounts Payable Contact'), Field('vendor_rep', db.contacts, label='Vendor Representative'), Field('documentation_required', 'list:reference documentation', comment='Click to select. Use Ctrl key for multiple selection.') ) db.purchase_orders.taxable.requires = IS_IN_SET(['Yes', 'No']) db.purchase_orders.shipto.requires = IS_IN_DB(db, db.locations.id, '% (name)s', zero='Choice required') db.purchase_orders.billto.requires = IS_IN_DB(db, db.locations.id, '% (name)s', zero='Choice required') db.purchase_orders.supplier.requires = IS_IN_DB(db, db.suppliers.id, '% (name)s', zero='Choice required') db.purchase_orders.del_terms.requires = IS_IN_DB(db, db.del_terms.id, '%(name)s', zero='Choice required') db.purchase_orders.currency.requires = IS_IN_DB(db, db.currencies.id, '%(name)s', zero='Choice required') db.purchase_orders.pmt_terms.requires = IS_IN_DB(db, db.pmt_terms.id, '%(name)s', zero='Choice required') db.purchase_orders.po_contact.requires = IS_IN_DB( db(), db.contacts.id, '%(first_name)s, %(middle_name)s, % (last_name)s, %(generation)s ', zero='Choice required') db.purchase_orders.ap_contact.requires = IS_IN_DB( db(), db.contacts.id, '%(first_name)s', zero='Choice required') db.purchase_orders.vendor_rep.requires = IS_IN_DB( db(), db.supplier_contacts.id, '%(first_name)s', zero='Choice required') db.define_table('suppliers', Field('name', length=256, required=True, notnull=True), Field('address', length=64), Field('address_2', length=64), Field('city', length=32), Field('state', length=24), Field('zip', length=18), Field('website', length=512, requires=IS_URL()), format = '%(name)s' ) db.define_table( 'supplier_contacts', Field('supplier_id', db.suppliers), Field('first_name', length=32, required=True, notnull=True), Field('middle_name', length=32), Field('last_name', length=32, required=True, notnull=True), Field('generation', length=16), Field('email', length=512, requires=IS_EMPTY_OR(IS_EMAIL('invalid email'))), Field('mobile', length=18, label='Mobile phone'), Field('land_line', length=18), Field('fax', length=18), format='%(first_name)s, %(middle_name)s, %(last_name)s, % (generation)s' ) db.supplier_contacts.supplier_id.requires = IS_IN_DB( db, db.suppliers.id, '%(name)s', zero='Choose' ) db.supplier_contacts.supplier_id.readable = False db.supplier_contacts.supplier_id.writable = False +++ ++ This is the actual call from the controller: # we already know the supplier_id and vendor_rep hidden['supplier']=supplier_id hidden['vendor_rep'=vendor_rep field_lst = 'issue_date number shipto billto del_terms currency pmt_terms project_no taxable po_contact ap_contact documentation_required'.split(' ') form = SQLTABLE(db.suppliers, fields=field_lst, hidden=hidden) On
[web2py] Re: Published my collection of plugins
It's just GREAT !! I love the Suggest Widget. On Aug 29, 7:00 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: SQLFORM.grid(query) SQLFORM.smartgrid(table) are replacements for SQLTABLE and crud. they have search, pagination, sorting, and lots more. Give them a try. On Aug 29, 4:40 am, peter peterchutchin...@gmail.com wrote: Thanks for quick bug fixes Are you considering adding pagination? Peter On Aug 29, 5:16 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I would definitively want to see multiline records in SQLFORM.grid. Is anybody interested in doing this? Massimo On Aug 28, 11:06 pm, kenji4569 hos...@s-cubism.jp wrote: T I got some bug reports for the Solid Table, and fixed the bugs: OrderbySelector fails when current_orderby is nullhttps://github.com/kenji4569/sqlabs/issues/34 solidtable fails when headers='labels'https://github.com/kenji4569/sqlabs/issues/32 SOLID TABLE fails when columns=[[a,b],None,[c,d]]https://github.com/kenji4569/sqlabs/issues/37 Thanks for reporting them. On 8月28日, 午前2:27, kenji4569 hos...@s-cubism.jp wrote: Thank you all for your wonderful comments. Do you want to host and manage all plugins? Currently I doubt if I could commit this, though I want to contribute more as much as I could. I see you take time to make order in sqltable :O. Please subscribe to web2py-developers. I will subscribe to it. But first I need time to see how the development goes on. On 8月27日, 午後9:30, Bruno Rocha rochacbr...@gmail.com wrote: On Sat, Aug 27, 2011 at 8:01 AM, Martín Mulone mulone.mar...@gmail.comwrote: Bruno extracolumns are in SQLTABLE. really? LOL.. never knew about it.- Hide quoted text - - Show quoted text -
[web2py] natural language search in SQLFORM.grid and smartgrid
A new feature in trunk allows natural language search in SQLFORM.grid and smartgrid for example given: db.define_table('person',Field('name')) form = SQLFORM.smartgrid(db.person) you can search for name is max name is Max person.name is Max person.name = Max person.name == Max name contains max name contains m and name ends with x name starts with m and name is not equal mick name starts with m and not name is equal mick name starts with m and not name equals mick name is equal or greater than max and name ends with x etc. The only rule is that field names cannot contain spaces.
[web2py] Re: GAE select all does not iterate
like is not supported on GAE, and for your particular like clause there is no real work-around for that on GAE. there are some tricks for a couple of like cases mentioned on this thread here: http://stackoverflow.com/questions/47786/google-app-engine-is-it-possible-to-do-a-gql-like-query
Re: [web2py] natural language search in SQLFORM.grid and smartgrid
I did not look in the source yet. But. Is it possible to support i18n? name contains m To name contém m name is equal or greater than To name é igual ou maior que Is there some way to have a dictionary of terms? (what if a field is named 'starts'? ) http://zerp.ly/rochacbruno Em 29/08/2011 12:23, Massimo Di Pierro massimo.dipie...@gmail.com escreveu: A new feature in trunk allows natural language search in SQLFORM.grid and smartgrid for example given: db.define_table('person',Field('name')) form = SQLFORM.smartgrid(db.person) you can search for name is max name is Max person.name is Max person.name = Max person.name == Max name contains max name contains m and name ends with x name starts with m and name is not equal mick name starts with m and not name is equal mick name starts with m and not name equals mick name is equal or greater than max and name ends with x etc. The only rule is that field names cannot contain spaces.
[web2py] Re: natural language search in SQLFORM.grid and smartgrid
If a field is named starts you can do starts starts with m supporting internationalization here would be possible, but a mess. I would not recommend it. I am not even sure full language in english is a good idea. On Aug 29, 10:41 am, Bruno Rocha rochacbr...@gmail.com wrote: I did not look in the source yet. But. Is it possible to support i18n? name contains m To name contém m name is equal or greater than To name é igual ou maior que Is there some way to have a dictionary of terms? (what if a field is named 'starts'? ) http://zerp.ly/rochacbruno Em 29/08/2011 12:23, Massimo Di Pierro massimo.dipie...@gmail.com escreveu: A new feature in trunk allows natural language search in SQLFORM.grid and smartgrid for example given: db.define_table('person',Field('name')) form = SQLFORM.smartgrid(db.person) you can search for name is max name is Max person.name is Max person.name = Max person.name == Max name contains max name contains m and name ends with x name starts with m and name is not equal mick name starts with m and not name is equal mick name starts with m and not name equals mick name is equal or greater than max and name ends with x etc. The only rule is that field names cannot contain spaces.
[web2py] [ANNOUNCE] uWSGI 0.9.9
Hi everyone, i am pleased to announce a new major release of the uWSGI project. The 0.9.9 version focuses on optimizations in various area, an improved spooler and native gevent support. A new python-specific feature is the 'pyshell': adding --pyshell to your options will run a python shell in the uwsgi environment (useful for testing the uwsgi api). The rack plugin has been improved and the old-sharedarea has been revamped to support 64bit. Pump (an alternative to WSGI) support has been added, it is only a bunch of lines, so do not flame about it :) A new Emperor mode, called Tyrant, is available for highly-untrusted environments. This is the first release linkable as a shared library (will be the base for pypy support). Look at skel.c in source distribution for an example. * Changelog for 0.9.9 [20110829] - various spooler improvements - upload progress optimizations and fixes - new emperor mode: Tyrant http://projects.unbit.it/uwsgi/wiki/Emperor#tyrant - allows multiple --ini options - better binary path detection - gevent loop engine support http://projects.unbit.it/uwsgi/wiki/Gevent - resolve domain names in socket logging - snmp fixes and reintroduction of the snmp-api - fixed grunt mode - you can specify build profile via env var UWSGI_PROFILE - reintroduction of string-based multiapp - new option --emperor-throttle - improved queue and sharedarea subsystems http://projects.unbit.it/uwsgi/wiki/QueueFramework http://projects.unbit.it/uwsgi/wiki/SharedArea - uWSGI can now be built as a shared library - new api attribute: uwsgi.magic_table - improved apache2 module - new option --pyshell - allow threads in gateways - fastrouter improvements http://projects.unbit.it/uwsgi/wiki/FastRouter - the application list is now shared and exported to the api - allows setting the thread stack size - UWSGI_APPID for better multiapp hosting http://projects.unbit.it/uwsgi/wiki/uWSGIVars - better reloading in lazy mode - native pump support http://projects.unbit.it/uwsgi/wiki/Pump - various rack fixes - support for attaching binary data in the executable - new option --set - extreme-optimized http protocol parser - WSGI handler optimizations You can download it from: http://projects.unbit.it/downloads/uwsgi-0.9.9.tar.gz or pip install uwsgi Many thanks to all the people helping in the project. Remember to ping me for adding you in the CONTRIBUTORS file. -- Roberto De Ioris http://unbit.it JID: robe...@jabber.unbit.it
[web2py] Jquerymobile plugin limit exceeded?
hello i´m creating an app in web2py for mobile devices i have an issue i have a view that needs to parse a list . This list can go up to 1300 rows of data! Sometimes the pages loads empty and i started to play with range values. {{extend 'plugin_jqmobile/layout.html'}} ul data-role=listview data-inset=true data-filter=true li data-role='list-divider'{{=key}}/li {{for x in range(0,*890*):}} li {{=allAlm[x][0]}} {{=allAlm[x][2]}} /li {{pass}} /ul if the range is from (0,999) the page loads empty like some error or limit was exceeded. Does anyone knows something about this? If the list has only 400 or 500 rows of data to parse, i have no problem with this code. thank you
[web2py] Re: new version of printed book?
On Mon, 29 Aug 2011 06:36:55 -0700 (PDT) Massimo Di Pierro massimo.dipie...@gmail.com wrote: Hopefully by the end of september. OK. Thank you for the info. We'll be patient. ;) Sincerely, Gour -- “In the material world, conceptions of good and bad are all mental speculations…” (Sri Caitanya Mahaprabhu) http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 signature.asc Description: PGP signature
Re: [web2py] Re: natural language search in SQLFORM.grid and smartgrid
I think database administration should also have a natural language tool to update all/subset of record for example. 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com If a field is named starts you can do starts starts with m supporting internationalization here would be possible, but a mess. I would not recommend it. I am not even sure full language in english is a good idea. On Aug 29, 10:41 am, Bruno Rocha rochacbr...@gmail.com wrote: I did not look in the source yet. But. Is it possible to support i18n? name contains m To name contém m name is equal or greater than To name é igual ou maior que Is there some way to have a dictionary of terms? (what if a field is named 'starts'? ) http://zerp.ly/rochacbruno Em 29/08/2011 12:23, Massimo Di Pierro massimo.dipie...@gmail.com escreveu: A new feature in trunk allows natural language search in SQLFORM.grid and smartgrid for example given: db.define_table('person',Field('name')) form = SQLFORM.smartgrid(db.person) you can search for name is max name is Max person.name is Max person.name = Max person.name == Max name contains max name contains m and name ends with x name starts with m and name is not equal mick name starts with m and not name is equal mick name starts with m and not name equals mick name is equal or greater than max and name ends with x etc. The only rule is that field names cannot contain spaces.
[web2py] Re: natural language search in SQLFORM.grid and smartgrid
The medium term plan is replace the entire appadmin with a few lines of SQLFORM.smatgrid(...) smartgrid allows to register a callback to perform operations on selected rows (update, delete) but needs a little more work. On Aug 29, 11:45 am, António Ramos ramstei...@gmail.com wrote: I think database administration should also have a natural language tool to update all/subset of record for example. 2011/8/29 Massimo Di Pierro massimo.dipie...@gmail.com If a field is named starts you can do starts starts with m supporting internationalization here would be possible, but a mess. I would not recommend it. I am not even sure full language in english is a good idea. On Aug 29, 10:41 am, Bruno Rocha rochacbr...@gmail.com wrote: I did not look in the source yet. But. Is it possible to support i18n? name contains m To name contém m name is equal or greater than To name é igual ou maior que Is there some way to have a dictionary of terms? (what if a field is named 'starts'? ) http://zerp.ly/rochacbruno Em 29/08/2011 12:23, Massimo Di Pierro massimo.dipie...@gmail.com escreveu: A new feature in trunk allows natural language search in SQLFORM.grid and smartgrid for example given: db.define_table('person',Field('name')) form = SQLFORM.smartgrid(db.person) you can search for name is max name is Max person.name is Max person.name = Max person.name == Max name contains max name contains m and name ends with x name starts with m and name is not equal mick name starts with m and not name is equal mick name starts with m and not name equals mick name is equal or greater than max and name ends with x etc. The only rule is that field names cannot contain spaces.
Re: [web2py] Re: Changed field name in table def, database OK, but getting key error [SOLVED]
On Thu, Aug 25, 2011 at 9:31 PM, Eric Scott erictransla...@gmail.comwrote: Perfect! This thread solved at least one major headache, and perhaps another even greater headache. Massimo, I'm embarrassed I had not tried grep. It worked. I found the string in the db_wizard_populate.py file. I used the wizard to quickly recreate my app's database structure when I couldn't get the migrate to work. And speaking of problems migrating, Richard may have provided me with the missing info I needed for migration. I knew that it was the auth tables that were problematic, but I was so busy trying to mix up migrate and fake_migrate True settings that I never thought to set them to migrate=False. I'll try that next time and see if it works. If that is a known issue, it would be nice to mention it in the next ed. of the book, next to the mysql migrate issues. Thanks to both of you. Could it be enough to start your app with command line and be able to interact with it programmatically? http://web2py.com/book/default/chapter/04#Command-Line-Options Here what I put in my bash alias file : alias SHORTCUT='cd ~ cd LOCATION OF YOUR WEB2PY FOLDER/version_198-2/web2py/ python web2py.py -a 'PASSWORD4ADMIN' -i 127.0.0.1 -p 8001 -S NAMEOFYOURAPP -M auto' I use a other port number then the main instance of web2py use with the dev server... You can more simply send this command when you are in the web2py folder : python web2py.py -a 'PASSWORD4ADMIN' -i 127.0.0.1 -p 8001 -S NAMEOFYOURAPP -M auto' Richard Now if I could only figure out how to set web2py command line parameters when using apache/mod_wsgi... Eric On Aug 25, 3:03 pm, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello Eric, I would help, but I have no clue... Do you alternate between SQLite and Postgres? If yes, web2py always try to recreate the auth(s) tables that is a problem I often have... To solve it you must define the auth(s) tables in the db.py and set them to migrate=false... so web2py stop to trigger their creation each time... Richard On Thu, Aug 25, 2011 at 1:53 PM, Eric Scott erictransla...@gmail.com wrote: I'm using postgresql. I had to change a field name in my table def, which are in the web2py models. The database changed accordingly, but now I get a key error when I try to insert a new record using appadmin. I made sure appadmin.py is the latest and greatest. Still getting key error. I don't dare drop the db since each time I've done that before I've not been able to get it running again, no matter how many variations of migrate and fake_migrate I tried. So end up having to re-create the app, and then copy in the files, which takes a long time. I love web2py but database issues are driving me nuts. Can someone please help me? My app is so close to finished. Here's the traceback Traceback (most recent call last): File /home/www-data/web2py/gluon/restricted.py, line 192, in restricted exec ccode in environment File /home/www-data/web2py/applications/baristacode/controllers/ appadmin.py, line 411, in module File /home/www-data/web2py/gluon/globals.py, line 145, in lambda self._caller = lambda f: f() File /home/www-data/web2py/applications/baristacode/controllers/ appadmin.py, line 126, in insert form = SQLFORM(db[table], ignore_rw=ignore_rw) File /home/www-data/web2py/gluon/sqlhtml.py, line 830, in __init__ inp = self.widgets.options.widget(field, default) File /home/www-data/web2py/gluon/sqlhtml.py, line 218, in widget options = requires[0].options() File /home/www-data/web2py/gluon/validators.py, line 438, in options self.build_set() File /home/www-data/web2py/gluon/validators.py, line 421, in build_set fields = [self.dbset.db[self.ktable][k] for k in self.fields] File /home/www-data/web2py/gluon/dal.py, line 4675, in __getitem__ return dict.__getitem__(self, str(key)) KeyError: 'name_string' By the way, I changed the field name from name_string to name. Somewhere, name_string is still cached. I just can't figure out where. I've cleared the caches, restarted, etc etc. Thanks in advance for your help. Eric
[web2py] Re: crud not updating
emailed you a package anthony. Can't get much simpler than this. I don't get it. The second crud.update call is made with the same parameters, same session but gets a different result. CONTROLLER def onaccept(form): print(accepted) def test(): print(request.vars) print(request.args) print(session) form=crud.update(db[customer], 1, onaccept=onaccept) return dict(form=form) VIEW {{=form}} On Aug 29, 5:14 am, Bruno Rocha rochacbr...@gmail.com wrote: On Mon, Aug 29, 2011 at 12:59 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Not automatically. OK, I was just thinking if it could be the origin of the problem.
[web2py] Re: SQLFORM not handling hidden fields? Or do I have a bug?
Anthony, Good catch. The form should be SQLFORM, the table should be db.purchase_orders. bangs head on desk On Aug 29, 10:18 am, Anthony abasta...@gmail.com wrote: Did you show the correct controller code? Your form is define as a SQLTABLE (rather than SQLFORM), and the table argument is db.suppliers, not db.purchase_orders. Anthony On Monday, August 29, 2011 7:33:25 AM UTC-4, Cliff wrote: Not sue that would help. The insert goes into purchase_orders, not supplier_contacts. On Aug 26, 4:16 pm, Anthony abas...@gmail.com wrote: Does it work if you set db.supplier_contacts.supplier_id.writable = True in the controller function? On Friday, August 26, 2011 11:12:31 AM UTC-4, Cliff wrote: Massimo, Thank you. Of course. Here are are the real table defs: +++ ++ db.define_table('purchase_orders', Field('issue_date', 'date'), Field('number', length=24, requires=IS_NOT_EMPTY(), required=True, notnull=True, comment='Required'), Field('supplier', db.suppliers), Field('shipto', db.locations, label='Ship To'), Field('billto', db.locations, label='Bill To'), Field('del_terms', db.del_terms, label='Delivery Terms'), Field('currency', db.currencies), Field('pmt_terms', db.pmt_terms, label='Payment Terms'), Field('project_no', length=12, label='Project Number'), Field('taxable', 'list:string', default='No'), Field('po_contact', db.contacts, label='Purchase Order Contact'), Field('ap_contact', db.contacts, label='Accounts Payable Contact'), Field('vendor_rep', db.contacts, label='Vendor Representative'), Field('documentation_required', 'list:reference documentation', comment='Click to select. Use Ctrl key for multiple selection.') ) db.purchase_orders.taxable.requires = IS_IN_SET(['Yes', 'No']) db.purchase_orders.shipto.requires = IS_IN_DB(db, db.locations.id, '% (name)s', zero='Choice required') db.purchase_orders.billto.requires = IS_IN_DB(db, db.locations.id, '% (name)s', zero='Choice required') db.purchase_orders.supplier.requires = IS_IN_DB(db, db.suppliers.id, '% (name)s', zero='Choice required') db.purchase_orders.del_terms.requires = IS_IN_DB(db, db.del_terms.id, '%(name)s', zero='Choice required') db.purchase_orders.currency.requires = IS_IN_DB(db, db.currencies.id, '%(name)s', zero='Choice required') db.purchase_orders.pmt_terms.requires = IS_IN_DB(db, db.pmt_terms.id, '%(name)s', zero='Choice required') db.purchase_orders.po_contact.requires = IS_IN_DB( db(), db.contacts.id, '%(first_name)s, %(middle_name)s, % (last_name)s, %(generation)s ', zero='Choice required') db.purchase_orders.ap_contact.requires = IS_IN_DB( db(), db.contacts.id, '%(first_name)s', zero='Choice required') db.purchase_orders.vendor_rep.requires = IS_IN_DB( db(), db.supplier_contacts.id, '%(first_name)s', zero='Choice required') db.define_table('suppliers', Field('name', length=256, required=True, notnull=True), Field('address', length=64), Field('address_2', length=64), Field('city', length=32), Field('state', length=24), Field('zip', length=18), Field('website', length=512, requires=IS_URL()), format = '%(name)s' ) db.define_table( 'supplier_contacts', Field('supplier_id', db.suppliers), Field('first_name', length=32, required=True, notnull=True), Field('middle_name', length=32), Field('last_name', length=32, required=True, notnull=True), Field('generation', length=16), Field('email', length=512, requires=IS_EMPTY_OR(IS_EMAIL('invalid email'))), Field('mobile', length=18, label='Mobile phone'), Field('land_line', length=18), Field('fax', length=18), format='%(first_name)s, %(middle_name)s, %(last_name)s, % (generation)s' ) db.supplier_contacts.supplier_id.requires = IS_IN_DB( db, db.suppliers.id, '%(name)s', zero='Choose' ) db.supplier_contacts.supplier_id.readable = False db.supplier_contacts.supplier_id.writable = False +++ ++ This is the actual call from the controller: # we already know the supplier_id and vendor_rep hidden['supplier']=supplier_id hidden['vendor_rep'=vendor_rep field_lst = 'issue_date number shipto billto del_terms currency pmt_terms project_no taxable po_contact
[web2py] Re: SQLFORM not handling hidden fields? Or do I have a bug?
It would look something like this: db.define_table('dogs', Field('dog_name'), Field('dog_birthdate', 'date'), Field('dog_weight', 'integer'), Field('dog_owner', db.owner) ) db.dogs.dog_owner.requires=IS_IN_DB(db, db.dogs.id, '%(owner_name)s', zero=Choose an owner) Caveat: not closely checked for typos, missing commas, unclosed parends etc. On Aug 29, 10:14 am, DenesL denes1...@yahoo.ca wrote: Cliff, please post the related dogs table model.
[web2py] Re: Is it safe to run to web2py instances on the same database?
Hard to tell from your application description but sometimes it's better to implement inter-application communication, for example through an API or RPC.
[web2py] Re: SQLFORM not handling hidden fields? Or do I have a bug?
On Aug 29, 1:22 pm, Cliff cjk...@gmail.com wrote: It would look something like this: db.define_table('dogs', Field('dog_name'), Field('dog_birthdate', 'date'), Field('dog_weight', 'integer'), Field('dog_owner', db.owner) ) db.dogs.dog_owner.requires=IS_IN_DB(db, db.dogs.id, '%(owner_name)s', zero=Choose an owner) I think you want: db.dogs.dog_owner.requires=IS_IN_DB(db, db.owner.id, '%(owner_name)s', zero=Choose an owner) Caveat: not closely checked for typos, missing commas, unclosed parends etc.
[web2py] Some powerTable questions
Hello, I have a few question on the power table: - Can I make the columns re-sizable? - Can I display a column hierarchically? I want to display a little triangle or little + at the left of each item in a column so the user can unfold the item like if it was a folder containing other folders and files. Thank for this plug-in. This is great work.
[web2py] Re: table, grid, smartgrid, getting better
No need to do a fresh install. Why clobber all your test data? Check out one or more of the sqlite gui interfaces at this link: http://stackoverflow.com/questions/1507506/what-are-good-open-source-gui-sqlite-database-managers Then drop the column using the gui. On Aug 28, 9:51 am, Juan Tiger goldenboy...@gmail.com wrote: I using sqlite, alter table does not support drop columns, so you must try a fresh install 2011/8/24 Johann Spies johann.sp...@gmail.com TypeError: lambda() takes exactly 1 argument (2 given) I still get this error with the following model (all 'represent' lines commented out): db.define_table('akb_articles', Field('title'), Field('primaryauthor'), Field('authors', 'text'), Field('rp_author', length=64, requires = IS_EMPTY_OR(IS_IN_DB(db,'akb_reprint.uuid', '%(rp_author)s'))), Field('journal', requires = IS_IN_DB(db,'akb_journal.uuid', '%(title)s')), Field('bib_id'), Field('bib_pages'), Field('doctype'), Field('language'), Field('abstract', 'text'), Field('bib_vol'), Field('bib_date'), Field('url'), Field('pubyear', compute= lambda x: x['bib_date'][-4:]), Field('ut', # isi-unieke rekordnommer requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.ut'))), Field('scopus_id', requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.scopus_id'))), Field('sabinet_id', requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.sabinet_id'))), Field('isap_id', requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.isap_id'))), Field('category', 'list:string', IS_EMPTY_OR( IS_IN_DB(db,'akb_categories.uuid', '%(category)s', multiple=True))), Field('heading', 'list:string', IS_EMPTY_OR( IS_IN_DB(db,'akb_headings.uuid', '%(headings)s', multiple=True))), Field('art_eq',compute= lambda x: art_ekw(x)), akb_signature, #format = '%(title)s' ) There is no 'lambda' in akb_signature. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence. 2 Pet. 1:2b,3a
[web2py] Howto change request.uri_language through URL function?
I want to change the application language through URL function, but this doesn't expect the lang parameter. I did some tests with these adresses http://127.0.0.1:8000/es-es/default/index and http://127.0.0.1:8000/fr-fr/default/index and it changed the application language due to gluon.rewrite. But I want to do this with URL function in order to put in the website a Language Selector (SELECT and A tag). Massimo or somebody else, any clue?
[web2py] Say My Name Example not working, version 1.98.2
I recently decided to try web2py and so I am going through the tutorials in Chapter 3. I have Version 1.98.2. When I got to the Say My Name Example, I followed the steps, but I found out that I have to add response.generic_patterns = ['*'] because I kept getting Invalid View. Ok, so in my default controller I did this: def first(): response.generic_patterns = ['*'] return dict() def second(): response.generic_patterns = ['*'] return dict() Then under views, I created first.html and second html: first.html {{extend 'layout.html'}} What is your name? form action=second input name=visitor_name / input type=submit / /form second.html {{extend 'layout.html'}} h1 Hello {{=request.vars.visitor_name}}/h1 Now when I try to see first.html, it just displays First as a title, but no form is present. Any ideas why this is happening?? Thank you!
[web2py] Re: table, grid, smartgrid, getting better
Hi, I found a small bug: You can get to the edit form by clicking the 'Edit' button in one row of the grid. It calls this URL: http://127.0.0.1:8000/test/default/index/person/edit/person/1?_signature=... So far so good Using the view button in a row you can get to the non editable form of a single record. There is an 'Edit' button too, but that one is defunct. It tries to send you to that URL: http://127.0.0.1:8000/test/default/index/person/Edit/person/1?_signature=... the difference is the capitalised 'Edit' in the URL, which causes the problem. In any case, I think the grid/smartgrid thingy is a great new feature of a great framework, thank you for that. stephan
Re: [web2py] Some powerTable questions
Datatables has resizeable feature. So you can do it with a bit of javascript. But there is not an API for that in plugin yet. PowerTable will be rewriten, may be using solidtable as base. Web2py now has too many table/grid options and I think we can just extend the existing best ones. Powertable already has nested tables 'details' but allow only obe level. Using the new extracolumns feature in sqltable or solidtable we can achieve your tree like nested tables. A bit of jquery and this would be easy. I am not saying you dont have to use powertable, just that it is a little deprecated and can be very better with new features (web2py evolves too fast!) The only features that powertable has and other dont. is nested tables, by column filtering, edit in place, tooltips, ajax. Putting this 5 features in smartgrid and this will be the best option. http://zerp.ly/rochacbruno Em 29/08/2011 15:52, Pierre Thibault pierre.thibau...@gmail.com escreveu: Hello, I have a few question on the power table: - Can I make the columns re-sizable? - Can I display a column hierarchically? I want to display a little triangle or little + at the left of each item in a column so the user can unfold the item like if it was a folder containing other folders and files. Thank for this plug-in. This is great work.
[web2py] Re: SQLFORM not handling hidden fields? Or do I have a bug?
Does it insert the non-hidden fields, or is no record getting inserted at all? On Friday, August 26, 2011 5:43:15 AM UTC-4, Cliff wrote: I use SQLFORM something like this: fields = 'dog_name dog_weight dog_birtdate'.split(' ') hidden = {'dog_owner' : some_known_value} # We already know who the owner is SQLFORM(db.dogs, fields=fields, hidden=hidden) The hidden fields are on the form. When I submit the form, they are in request.vars, but SQLFORM does not insert them in the database. Is this the way it's supposed to work or do I have a bug? Thanks, Cliff Kachinske
[web2py] List widget issue when invalid form
Hi everyone, Since it's my first post, I'd like to first say great framework to the whole team. I'm really enjoying using it. I think I've found a small bug in the handling of list fields in an invalid form. I have a list:string field and another required field. When there is only 1 input field and value for the list field and the submitted form is invalid (the other field is invalid), the returned error form splits my 1 value up into individual characters since it assumes the request.var is an array. I've traced it down to sqlhtml in this section around row 1090: if hasattr(field, 'widget') and field.widget and fieldname in request_vars: if fieldname in self.vars: value = self.vars[fieldname] etc widget = field.widget(field, value) Then ListWidget exects to be getting an array as the value. So might need a check on the value type if using self.vars, like: if field.type.startswith('list:') and isinstance(value, str): value = [value] Thanks Ryan
[web2py] Re: Some powerTable questions
Thank you. So, I don't have data coming SQL. Would then recommend solidtable? On 29 août, 15:46, Bruno Rocha rochacbr...@gmail.com wrote: Datatables has resizeable feature. So you can do it with a bit of javascript. But there is not an API for that in plugin yet. PowerTable will be rewriten, may be using solidtable as base. Web2py now has too many table/grid options and I think we can just extend the existing best ones. Powertable already has nested tables 'details' but allow only obe level. Using the new extracolumns feature in sqltable or solidtable we can achieve your tree like nested tables. A bit of jquery and this would be easy. I am not saying you dont have to use powertable, just that it is a little deprecated and can be very better with new features (web2py evolves too fast!) The only features that powertable has and other dont. is nested tables, by column filtering, edit in place, tooltips, ajax. Putting this 5 features in smartgrid and this will be the best option. http://zerp.ly/rochacbruno Em 29/08/2011 15:52, Pierre Thibault pierre.thibau...@gmail.com escreveu:
[web2py] Re: Say My Name Example not working, version 1.98.2
Are the view files in views (incorrect) or views/default (correct)? You don't need response.generic_patterns = ['*'] when you are creating view files. You can put response.generic_patterns = ['*'] in db.py model file so that it applies to your whole app.
[web2py] Re: Say My Name Example not working, version 1.98.2
Rami, I'm using the same version and just follow the chapter but It works fine. It runs under Rocket WSGI web server comming with web2py. If you are using another web server, then you should check the configuration. Or it could be a typo somewhere. I will send you my app to your mail address. On Aug 29, 2:29 pm, rami beatrisr...@gmail.com wrote: I recently decided to try web2py and so I am going through the tutorials in Chapter 3. I have Version 1.98.2. When I got to the Say My Name Example, I followed the steps, but I found out that I have to add response.generic_patterns = ['*'] because I kept getting Invalid View. Ok, so in my default controller I did this: def first(): response.generic_patterns = ['*'] return dict() def second(): response.generic_patterns = ['*'] return dict() Then under views, I created first.html and second html: first.html {{extend 'layout.html'}} What is your name? form action=second input name=visitor_name / input type=submit / /form second.html {{extend 'layout.html'}} h1 Hello {{=request.vars.visitor_name}}/h1 Now when I try to see first.html, it just displays First as a title, but no form is present. Any ideas why this is happening?? Thank you!
[web2py] Server side form validation
Hi group, first time post! A question about server side form validation. I have been following the tutorials on the web2py website and I'm building a simple form like this in the controller: form=FORM(TABLE(TR(Username:,INPUT(_type=text,_name=username,requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'users.username')])), TR(Email:,INPUT(_type=text,_name=email,requires=IS_EMAIL())), TR(,INPUT(_type=submit,_value=New User When I do this, is web2py doing the form validation server side, or is it using client side javascript methods to validate the users' input? I wouldn't want the end user to turn off javascript in the browser to bypass validation. I notice in the model I can also define my requirements like this: db.users.username.requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'users.username')] What's the difference between the two ways of defining form validation? Thanks in advance! :-) Chris
[web2py] Re: Server side form validation
Validation is always performed server side. if you use FORM(INPUT()) that each input gets its own requires=[..] if you use SQLFORM(table) than the requires are from the table.field.requires. Anyway, do not use FORM(...INPUT()...) but use SQLFORM.factory(...Field(...)...) It is more powerful. On Aug 29, 4:45 pm, leftcase christopherrow...@gmail.com wrote: Hi group, first time post! A question about server side form validation. I have been following the tutorials on the web2py website and I'm building a simple form like this in the controller: form=FORM(TABLE(TR(Username:,INPUT(_type=text,_name=username,requires =[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'users.username')])), TR(Email:,INPUT(_type=text,_name=email,requires=IS_EMAIL())), TR(,INPUT(_type=submit,_value=New User When I do this, is web2py doing the form validation server side, or is it using client side javascript methods to validate the users' input? I wouldn't want the end user to turn off javascript in the browser to bypass validation. I notice in the model I can also define my requirements like this: db.users.username.requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'users.username')] What's the difference between the two ways of defining form validation? Thanks in advance! :-) Chris
Re: [web2py] Re: Server side form validation
Thanks for the rapid reply Massimo, It is much appreciated. Chris On Aug 30, 2011 12:23 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Validation is always performed server side. if you use FORM(INPUT()) that each input gets its own requires=[..] if you use SQLFORM(table) than the requires are from the table.field.requires. Anyway, do not use FORM(...INPUT()...) but use SQLFORM.factory(...Field(...)...) It is more powerful. On Aug 29, 4:45 pm, leftcase christopherrow...@gmail.com wrote: Hi group, first time post! A question about server side form validation. I have been following the tutorials on the web2py website and I'm building a simple form like this in the controller: form=FORM(TABLE(TR(Username:,INPUT(_type=text,_name=username,requires =[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'users.username')])), TR(Email:,INPUT(_type=text,_name=email,requires=IS_EMAIL())), TR(,INPUT(_type=submit,_value=New User When I do this, is web2py doing the form validation server side, or is it using client side javascript methods to validate the users' input? I wouldn't want the end user to turn off javascript in the browser to bypass validation. I notice in the model I can also define my requirements like this: db.users.username.requires=[IS_NOT_EMPTY(), IS_NOT_IN_DB(db, 'users.username')] What's the difference between the two ways of defining form validation? Thanks in advance! :-) Chris
Re: [web2py] Re: Some powerTable questions
what is your data source? datatables can handle json and xml (but it is not implemented in the plugin, but can be done with JS), if you want a JSON based grid I recommend PowerGrid, another plugin I created. PowerGrid is based in JSON or PJSON, it comes with a default callback module, but you can specify any callback function wich returns JSON to be loaded in the grid.
[web2py] Re: Some powerTable questions
On 29 août, 20:26, Bruno Rocha rochacbr...@gmail.com wrote: what is your data source? I have XML data. datatables can handle json and xml (but it is not implemented in the plugin, but can be done with JS), if you want a JSON based grid I recommend PowerGrid, another plugin I created. PowerGrid is based in JSON or PJSON, it comes with a default callback module, but you can specify any callback function wich returns JSON to be loaded in the grid. I can transform my data in Python or JS. I don't care that much about coding the data transformation necessary to make things work. What seems to be the challenge is displaying the hierarchy I talk about. What would be your recommendation?
[web2py] Re: Published my collection of plugins
Hi, Thanks for the great contributions to web2py. I'm looking forward to trying them. I implemented web2py.plugin.elrte_widget.w2p and while it worked great with firefox, I had some problems using internet explorer. Specifically, the dropdown boxes, such as the colorpicker, disappear before I can make a selection. This happened with IE7 and IE8. I used the same IE browser to go to the http://elrte.org/demo and the problem didn't exist there. Does anyone else see this problem? - Tom
[web2py] Re: crud not updating
I think this might be a bug, but I haven't tracked it down yet. Could you please submit an issue on Google Code: http://code.google.com/p/web2py/issues/list Anthony On Monday, August 29, 2011 1:02:49 PM UTC-4, apple wrote: emailed you a package anthony. Can't get much simpler than this. I don't get it. The second crud.update call is made with the same parameters, same session but gets a different result. CONTROLLER def onaccept(form): print(accepted) def test(): print(request.vars) print(request.args) print(session) form=crud.update(db[customer], 1, onaccept=onaccept) return dict(form=form) VIEW {{=form}} On Aug 29, 5:14 am, Bruno Rocha rocha...@gmail.com wrote: On Mon, Aug 29, 2011 at 12:59 AM, Massimo Di Pierro massimo@gmail.com wrote: Not automatically. OK, I was just thinking if it could be the origin of the problem.
[web2py] Re: crud not updating
Can you try? crud.settings.detect_record_change = False SQLFORM has a mechanism to prevent two users from doing this: user 1) visualize and edit record user 2) visualize and edit record user 1) save changes user 2) save changes and override changes by user 1 in SQLFORM it is disabled by default. In crud it is enabled by default. crud.settings.detect_record_change = True Still something is wrong because you should get a message about it. On Aug 28, 2:18 pm, apple simo...@gmail.com wrote: If the database fails to update within CRUD is there a way I can view the error? I have a controller with this code that works fine: form=SQLFORM(table,a.id) if form.accepts(request.vars, session): response.flash=record updated I replace it with: form=crud.update(table, a.id) Now it works fine the first time the form is changed. Then the second time it correctly calls the controller but the database is not updated and the form reverts to the pre-change values. This continues so on odd submits it works and even submits it does not. It also seems to work on all submits when I excluded certain fields. I am thinking maybe there is a database error thrown inside CRUD but no error message is logged.
[web2py] Some improvements in scheduler
better locking system. Now heartbeat are adjusted automatically and dynamically (max 20 seconds apart).
[web2py] Nide browser IDE
Spiffy browser IDE but appears to require Node.js: http://coreh.github.com/nide/
[web2py] Re: crud not updating
can you also try replace form.accepts(): with form.process().accepted: I think of the latter as the new way of doing for processing. Massimo On Aug 29, 9:44 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Can you try? crud.settings.detect_record_change = False SQLFORM has a mechanism to prevent two users from doing this: user 1) visualize and edit record user 2) visualize and edit record user 1) save changes user 2) save changes and override changes by user 1 in SQLFORM it is disabled by default. In crud it is enabled by default. crud.settings.detect_record_change = True Still something is wrong because you should get a message about it. On Aug 28, 2:18 pm, apple simo...@gmail.com wrote: If the database fails to update within CRUD is there a way I can view the error? I have a controller with this code that works fine: form=SQLFORM(table,a.id) if form.accepts(request.vars, session): response.flash=record updated I replace it with: form=crud.update(table, a.id) Now it works fine the first time the form is changed. Then the second time it correctly calls the controller but the database is not updated and the form reverts to the pre-change values. This continues so on odd submits it works and even submits it does not. It also seems to work on all submits when I excluded certain fields. I am thinking maybe there is a database error thrown inside CRUD but no error message is logged.
[web2py] Re: crud not updating
Yes, that is in fact the problem, but shouldn't you be able to make two edits to a record in a row without an intervening failure? It's not just that a failure message is missing -- the behavior seems wrong. Anthony On Monday, August 29, 2011 10:44:35 PM UTC-4, Massimo Di Pierro wrote: Can you try? crud.settings.detect_record_change = False SQLFORM has a mechanism to prevent two users from doing this: user 1) visualize and edit record user 2) visualize and edit record user 1) save changes user 2) save changes and override changes by user 1 in SQLFORM it is disabled by default. In crud it is enabled by default. crud.settings.detect_record_change = True Still something is wrong because you should get a message about it. On Aug 28, 2:18 pm, apple sim...@gmail.com wrote: If the database fails to update within CRUD is there a way I can view the error? I have a controller with this code that works fine: form=SQLFORM(table,a.id) if form.accepts(request.vars, session): response.flash=record updated I replace it with: form=crud.update(table, a.id) Now it works fine the first time the form is changed. Then the second time it correctly calls the controller but the database is not updated and the form reverts to the pre-change values. This continues so on odd submits it works and even submits it does not. It also seems to work on all submits when I excluded certain fields. I am thinking maybe there is a database error thrown inside CRUD but no error message is logged.
Re: [web2py] Re: Some powerTable questions
something like this: http://wijmo.com/Wijmo-Complete/samples/#tree|overview or may be this: http://wijmo.com/Wijmo-Complete/samples/#grid|grouping-and-aggregates (the column resizing you talk http://wijmo.com/Wijmo-Complete/samples/#grid|column-resizing)
[web2py] Re: Howto change request.uri_language through URL function?
So something like this: http://www.amnesty.org/fr/how-you-can-help and not this: http://voiceofaccess.org/init/default/index?_language=fr-ca ?
[web2py] Re: Howto change request.uri_language through URL function?
The parametric router allows: routers = dict( # base router BASE = dict( default_application = app, ), app = dict( default_language = 'en', languages = ['en', 'it', 'pt', 'pt-br'], ), ) and than in the model you do: T.force(request.lang) Not clear whether anybody has ever tested this. Massimo On Aug 29, 2:26 pm, Alexander Cabezas alexcabez...@gmail.com wrote: I want to change the application language through URL function, but this doesn't expect the lang parameter. I did some tests with these adresseshttp://127.0.0.1:8000/es-es/default/index andhttp://127.0.0.1:8000/fr-fr/default/indexand it changed the application language due to gluon.rewrite. But I want to do this with URL function in order to put in the website a Language Selector (SELECT and A tag). Massimo or somebody else, any clue?
Re: [web2py] Re: Mobile detector
I commented in Anthony notes, but I will replicate it here. --- I created my own mechanism for mobile detection, which I am using for a long time. So there is one thing I decided. It is better to prefix instead of suffix. so I named my views as mobile.index.html instead of index.mobi. why? just because I can have .html, .load, .json, .xml for specific mobile scope too. and it is better to have mobile.index.html for mobile while index.html to browsers, same for mobile.index.json for index.json, and .load etc. --- http://code.google.com/p/web2py/source/detail?r=93578e588a1b22fd0c971932aed9823fb10df476
Re: [web2py] Re: Howto change request.uri_language through URL function?
On Aug 29, 2011, at 8:50 PM, Massimo Di Pierro wrote: The parametric router allows: routers = dict( # base router BASE = dict( default_application = app, ), app = dict( default_language = 'en', languages = ['en', 'it', 'pt', 'pt-br'], ), ) and than in the model you do: T.force(request.lang) Not clear whether anybody has ever tested this. Only unit tests. But the logic is pretty straightforward. Massimo On Aug 29, 2:26 pm, Alexander Cabezas alexcabez...@gmail.com wrote: I want to change the application language through URL function, but this doesn't expect the lang parameter. I did some tests with these adresseshttp://127.0.0.1:8000/es-es/default/index andhttp://127.0.0.1:8000/fr-fr/default/indexand it changed the application language due to gluon.rewrite. But I want to do this with URL function in order to put in the website a Language Selector (SELECT and A tag). Massimo or somebody else, any clue?
Re: [web2py] Re: Howto change request.uri_language through URL function?
On Aug 29, 2011, at 9:26 PM, Jonathan Lundell wrote: On Aug 29, 2011, at 8:50 PM, Massimo Di Pierro wrote: The parametric router allows: routers = dict( # base router BASE = dict( default_application = app, ), app = dict( default_language = 'en', languages = ['en', 'it', 'pt', 'pt-br'], ), ) and than in the model you do: T.force(request.lang) Not clear whether anybody has ever tested this. Only unit tests. But the logic is pretty straightforward. There's one more step required: based on whatever user input you want to use to select the language in the first place, you need to set request.lang before calling URL, at least the first time. Massimo On Aug 29, 2:26 pm, Alexander Cabezas alexcabez...@gmail.com wrote: I want to change the application language through URL function, but this doesn't expect the lang parameter. I did some tests with these adresseshttp://127.0.0.1:8000/es-es/default/index andhttp://127.0.0.1:8000/fr-fr/default/indexand it changed the application language due to gluon.rewrite. But I want to do this with URL function in order to put in the website a Language Selector (SELECT and A tag). Massimo or somebody else, any clue?
Re: [web2py] Re: Mobile detector
Good point. Couldn't you also do something like index.mobi.html or index.html.mobi? I don't think these view names would necessarily have to be exposed as URLs -- they just need to be used server side to render the page appropriately. Anthony On Tuesday, August 30, 2011 12:01:53 AM UTC-4, rochacbruno wrote: I commented in Anthony notes, but I will replicate it here. --- I created my own mechanism for mobile detection, which I am using for a long time. So there is one thing I decided. It is better to prefix instead of suffix. so I named my views as mobile.index.html instead of index.mobi. why? just because I can have .html, .load, .json, .xml for specific mobile scope too. and it is better to have mobile.index.html for mobile while index.html to browsers, same for mobile.index.json for index.json, and .load etc. --- http://code.google.com/p/web2py/source/detail?r=93578e588a1b22fd0c971932aed9823fb10df476