[web2py] Re: web2py 2.9.6 is out!
Thanks a lot, great work! Fortunate coincidence: I wanted to use Sphinx for my current web2py project and was thinking about the best way to integrate it ... and there it is already! :) Kind regards, Jan Am Dienstag, 2. September 2014 04:08:25 UTC+2 schrieb Massimo Di Pierro: This is a much improved revision. Lots of the changes are internal rewrites to strengthen the security and enable porting to bootstrap 3 in the next version. The list below does not give justice to how much work went into this release. Much better GAE support too. I strongly encourage you to upgrade. Many thanks all those who have helped in particular Niphlod, Anthony, and Leonel. Changelog: - Sphinx documentation (thanks Niphlod) - improved scheduler (thanks Niphlod) - increased security - support for SAML2 (with pysaml2) - postgres support for INSERT ... RETURING ... - ldap support for Certificate Authority (thanks Maggs and Shane) - improved support for S/Mime X.509 (thanks Gyuris) - better welcome app - support for Collection+JSON Hypermedia API (RESTful self documenting API) - jQuery 1.11 - codemirror 4.0.3 - support for the new janrain API - new web2py.py -G config to make GAE configuration easier - many small bug fixes -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: web2py 2.9.6 is out!
Having the table of contents always available gives the user a better experience in my opinion. something like meteor docs http://docs.meteor.com/ 2014-09-02 22:40 GMT+01:00 Tim Richardson t...@growthpath.com.au: Someone a long time ago added a jump to the top button in the scroll bar. Doesn't this help? Also, search is good for finding topics. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] 2.9.6 broke custom view template delimiters
In prior web2py versions, we can change the template delimiters by response.delimiters = ('?', '?') With 2.9.6, gluon/template.py in lines 282-290 were changed such that response.delimiters doesn't work. I tried response.app_settings = {'template_delimiters': ('?', '?')} which the new code seems to refer to, also doesn't work BTW, line 286 also have typo error: escaped_delimiters = (escape(elimiters [0]) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] SQLFORM.dictform fields show old values after submit?
Hi, I'm trying to understand what I'm doing wrongly. After submission, old values reappear in the fields. Pressing F5 is required to show the updated values. I'm using the latest and greatest web2py ( 2.9.6-stable+timestamp.2014.09.02.01.57.55) Controller: --- def index(): if session.config is None: session.config = dict(field1=1, field2=2) message = form = SQLFORM.dictform(session.config) if form.process().accepted: session.config.update(form.vars) message = updated return dict(message = message, form=form) View: - {{extend 'layout.html'}} {{=form}} {{=message}} Best regards, Stefaan. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Version 2.9.6 indeed breaks backward compat for some users
soapbox = True Version 2.9.6 does indeed make LIKE case-sensitive -- at least for Postgres and perhaps other databases. The change is that case sensitivity now mimics the underlying database that you are using at the moment. So if you're a MySql user you'll probably keep case-insensitive as your default, but if you are a Postgres user, all of your searches just changed from case insensitive to case sensitive. And if you want to switch from one to the other, God help you. Right off the bat, this killed my existing website. I do a lot of searches on strings (which is the whole point of using a database), and they are all case-insensitive. In fact, I never even knew the default in Postgres was case sensitive until this version of web2py. Until now, web2py protected me by providing a uniform DAL that made the underlying databases all look the same in this regard. I'm also miffed at this decision as I don't see an easy way to overcome it except by combing through the code and adding case_insensitive=True to every like, startswith, endswith, etc. I know very smart people were involved in this decision and I respect their combined brainpower, esp. Niphlod who I think rules the earth on Python and DB knowledge. But there is a disconnect between the devs and users who just need to keep sites running without re-writing code because of an upgrade. And I believe it weakens the DAL by exposing the underlying default of the database engine. It doesn't help us change from one DB engine to another, which is the biggest purpose of the DAL. soapbox = False -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Version 2.9.6 indeed breaks backward compat for some users
But there is a disconnect between the devs and users who just need to keep sites running without re-writing code because of an upgrade. There's no disconnect, if this breaks backwards compatibility it's a bug and it has to be fixed. I guess web2py needs more tests to prevent this from happening. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Version 2.9.6 indeed breaks backward compat for some users
On 3 September 2014 12:45, Joe Barnhart joe.barnh...@gmail.com wrote: I don't know whether it is possible in you case but a workaround maybe to the change the type of the fields searched in PostgreSQL to 'citext' which enables case insensitive indexing en searching in the backend. I have experimented with it and it did not break web2py. I did not even have to change my models. And I did not lose any data. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: web2py setup scripts for windows
Yes. I will add them. Thank you! On Tuesday, 2 September 2014 19:28:58 UTC-5, 黄祥 wrote: dear all, just want to share web2py setup scripts for windows (tested on windows 7 ultimate 64 bit). hopefully it can be added on web2py/scripts in the future release. thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: 2.9.6 broke custom view template delimiters
This will be fixed today with a new emergency release. On Wednesday, 3 September 2014 05:02:15 UTC-5, Jonathan New wrote: In prior web2py versions, we can change the template delimiters by response.delimiters = ('?', '?') With 2.9.6, gluon/template.py in lines 282-290 were changed such that response.delimiters doesn't work. I tried response.app_settings = {'template_delimiters': ('?', '?')} which the new code seems to refer to, also doesn't work BTW, line 286 also have typo error: escaped_delimiters = (escape(elimiters [0]) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Version 2.9.6 indeed breaks backward compat for some users
Hello Joe, yes we made this change. The problem is that its previous behavior was undetermined and was different across databases. So we treated it like a bug. LIKE is supposed to be case sensitive so we made sure like(...) is also case sensitive consistently across supported databases (or so we think). You can change that behavior: like(..., case_sensitive=False) Massimo On Wednesday, 3 September 2014 05:45:30 UTC-5, Joe Barnhart wrote: soapbox = True Version 2.9.6 does indeed make LIKE case-sensitive -- at least for Postgres and perhaps other databases. The change is that case sensitivity now mimics the underlying database that you are using at the moment. So if you're a MySql user you'll probably keep case-insensitive as your default, but if you are a Postgres user, all of your searches just changed from case insensitive to case sensitive. And if you want to switch from one to the other, God help you. Right off the bat, this killed my existing website. I do a lot of searches on strings (which is the whole point of using a database), and they are all case-insensitive. In fact, I never even knew the default in Postgres was case sensitive until this version of web2py. Until now, web2py protected me by providing a uniform DAL that made the underlying databases all look the same in this regard. I'm also miffed at this decision as I don't see an easy way to overcome it except by combing through the code and adding case_insensitive=True to every like, startswith, endswith, etc. I know very smart people were involved in this decision and I respect their combined brainpower, esp. Niphlod who I think rules the earth on Python and DB knowledge. But there is a disconnect between the devs and users who just need to keep sites running without re-writing code because of an upgrade. And I believe it weakens the DAL by exposing the underlying default of the database engine. It doesn't help us change from one DB engine to another, which is the biggest purpose of the DAL. soapbox = False -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] web2py list of dictionaries
In controller I create a list of dictionaries from an uploaded excel file. Then I populate the list to a html table. I use xlrd lib for reading excel file. The problem is the dictionary gets correctly populated from excel but when I append the dictionary to the list and enumerate the list it shows the last appended dictionary values for all the list items. Here is my code. Pl. help. In python shell when i build a dictionary and append it to list and then enumerate the list it is listed correctly. d = {} l = [] up = os.path.join(request.folder,'uploads') workbook = xlrd.open_workbook(os.path.join(request.folder,'uploads', 'meas.xls')) worksheet = workbook.sheet_by_name('Sheet1') num_rows = worksheet.nrows - 1 num_cells = worksheet.ncols - 1 curr_row = -1 while curr_row num_rows: curr_row += 1 row = worksheet.row(curr_row) #print 'Row:', curr_row curr_cell = -1 while curr_cell num_cells: curr_cell += 1 # Cell Types: 0=Empty, 1=Text, 2=Number, 3=Date, 4=Boolean, 5=Error, 6=Blank cell_type = worksheet.cell_type(curr_row, curr_cell) cell_value = worksheet.cell_value(curr_row, curr_cell) #print '', cell_type, ':', cell_value if curr_cell == 0: d['loc_of_work'] = cell_value if curr_cell == 1: d['n'] = cell_value if curr_cell == 2: d['t'] = cell_value if curr_cell == 3: d['l'] = cell_value if curr_cell == 4: d['b'] = cell_value if curr_cell == 5: d['d'] = cell_value print 'dict' print d.items() l.append(d) print 'len of list:' print len(l) print 'list:' for i,j in enumerate(l): print i,j -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Problem with auth.request_password
It worked this way, thank you :) Em terça-feira, 2 de setembro de 2014 14h18min11s UTC-3, Massimo Di Pierro escreveu: It appears there is a bug in reset_password. It will work if you do: http://domain/app/default/reset_password/verify/key; instead of http://domain/app/default/reset_password/key; On Tuesday, 2 September 2014 11:16:26 UTC-5, Leonardo Silvano wrote: So, i'm not using the default def user(): return dict(form=auth()) for user actions, instead i am creating just what i need, i sucessfully created login/logout/profile/change_password and request_reset_password, but i'm having some problems with reset_password, the key is correctly sent to my email but when i access it redirects to app/default/index. the link to reset_password is like http://domain/ app/default/reset_password/key Here the function on default controller: def reset_password(): form = auth.reset_password() return {'title':'Resetar Senha','form':form} I tested this key on the default def user(): return dict(form=auth()) and it worked, am I missing something? I did exctaly the same on the other ones and it worked fine. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: web2py list of dictionaries
Try appending a copy of d to l. I think python secretly doesn't append d, but appends a reference to d. So currently, in each iteration you overwrite the same d. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: web2py list of dictionaries
I forgot to mention that you can append a copy of d using l.append(d.copy()) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: web2py setup scripts for windows
hell no. I don't want 7-zip installed by web2py. and an old FIXED build of apache. And a FIXED version of python. Without checks. And Apache. On Windows. No, No, No, No to the setup scripts for windows archive. The configuration is fixed, old, and a poor duplicate of the ones we still have in automated scripts. On Wednesday, September 3, 2014 3:29:04 PM UTC+2, Massimo Di Pierro wrote: Yes. I will add them. Thank you! On Tuesday, 2 September 2014 19:28:58 UTC-5, 黄祥 wrote: dear all, just want to share web2py setup scripts for windows (tested on windows 7 ultimate 64 bit). hopefully it can be added on web2py/scripts in the future release. thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: web2py list of dictionaries
Python isn't doing any secret, he keeps appending the same object to the list. Just move the dictionary variable declaration to inside your loop so it declares a new dictionary each turn. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: SQLFORM.dictform fields show old values after submit?
Apparently I have to call if form.process(keepvalues=True).accepted instead. It makes sense only after you know about it ;) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Version 2.9.6 indeed breaks backward compat for some users
On Wednesday, September 3, 2014 9:37:24 AM UTC-4, Massimo Di Pierro wrote: Hello Joe, yes we made this change. The problem is that its previous behavior was undetermined and was different across databases. So we treated it like a bug. LIKE is supposed to be case sensitive so we made sure like(...) is also case sensitive consistently across supported databases (or so we think). You can change that behavior: like(..., case_sensitive=False) I wonder if we should add an option to set that database-wide -- something like DAL(..., case_sensitive_like=False). Also, should .startswith and .endswith have a case sensitive option? Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] getting type 'exceptions.IOError' [Errno 13] Permission denied over and over
Hello I just get the following error: type 'exceptions.IOError' [Errno 13] Permission denied everytime it points to a different line of the model. I discovered that by cleaning errors, cache and sessions, its work again. But now Im getting the error like every other time I test. Any hints?? Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: web2py list of dictionaries
Or, you could just move the line d = {} into the first while block. That will get you a new dictionary object for each pass. -- Joe On Wednesday, September 3, 2014 4:45:40 AM UTC-7, trr wrote: In controller I create a list of dictionaries from an uploaded excel file. Then I populate the list to a html table. I use xlrd lib for reading excel file. The problem is the dictionary gets correctly populated from excel but when I append the dictionary to the list and enumerate the list it shows the last appended dictionary values for all the list items. Here is my code. Pl. help. In python shell when i build a dictionary and append it to list and then enumerate the list it is listed correctly. d = {} l = [] up = os.path.join(request.folder,'uploads') workbook = xlrd.open_workbook(os.path.join(request.folder,'uploads', 'meas.xls')) worksheet = workbook.sheet_by_name('Sheet1') num_rows = worksheet.nrows - 1 num_cells = worksheet.ncols - 1 curr_row = -1 while curr_row num_rows: curr_row += 1 row = worksheet.row(curr_row) #print 'Row:', curr_row curr_cell = -1 while curr_cell num_cells: curr_cell += 1 # Cell Types: 0=Empty, 1=Text, 2=Number, 3=Date, 4=Boolean, 5=Error, 6=Blank cell_type = worksheet.cell_type(curr_row, curr_cell) cell_value = worksheet.cell_value(curr_row, curr_cell) #print '', cell_type, ':', cell_value if curr_cell == 0: d['loc_of_work'] = cell_value if curr_cell == 1: d['n'] = cell_value if curr_cell == 2: d['t'] = cell_value if curr_cell == 3: d['l'] = cell_value if curr_cell == 4: d['b'] = cell_value if curr_cell == 5: d['d'] = cell_value print 'dict' print d.items() l.append(d) print 'len of list:' print len(l) print 'list:' for i,j in enumerate(l): print i,j -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: web2py list of dictionaries
ahahah Joe that's exactly what I said. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Oracle Database
I'm trying to create a new application that will talk with an existing Oracle database. In models.py I have the following: db.define_table('CONSUMED_FILE_STATUSES', Field('CONSUMED_FILE_STATUS', type='string', length=25), Field('CONSUMED_FILE_STATUS_DESC', type='string', length=4000), migrate=False) This matches the table exactly to what is in the Oracle database. Very simple table. I'm able to view the database administration screen without a problem (seeing this table as a link). The application is connected to the Oracle database for sure. The problem arises when I want to see the contents of this table using web2py's database administration. I get the following error where the query is the following: db.CONSUMED_FILE_STATUSES.id0 ORA-00904: CONSUMED_FILE_STATUSES.ID: invalid identifier Any idea what is up? This is the first time I am interfacing web2py with an existing Oracle database. Thanks in advance! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Oracle Database
What's the primary key for that table if it doesn't have an ID? Web2py needs to know. If it's not an auto incrementing integer and it's say - the string in CONSUMED_FILE_STATUS - then you need to use keyed tables (declare primarykey=['CONSUMED_FILE_STATUS'] in your table definition). However, I don't think web2py supports keyed tables for Oracle **yet** but I guess you can try it. See: http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Legacy-databases-and-keyed-tables -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] SQLFORM.smartgrid 'module' object has no attribute 'split'
Hi All. I am trying to use SQLFORM.smartgrid: query=(db.cdr.accountcode==form.vars.nombre[0]) grid=SQLFORM.smartgrid(db.cdr,constraints=dict(cdr=query),details=False,create=False,editable=False,deletable=False,csv=False) But i received the follow exception: type 'exceptions.AttributeError' 'module' object has no attribute 'split' Versión web2py™Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 PythonPython 2.6.6: /usr/bin/python (prefix: /usr) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. Traceback (most recent call last): File /home/fvillarroel/www/web2py/gluon/restricted.py, line 220, in restricted exec ccode in environment File /home/fvillarroel/www/web2py/applications/freeswitch/controllers/repocallcltes.py, line 28, in module File /home/fvillarroel/www/web2py/gluon/globals.py, line 385, in lambda self._caller = lambda f: f() File /home/fvillarroel/www/web2py/gluon/tools.py, line 3287, in f return action(*a, **b) File /home/fvillarroel/www/web2py/applications/freeswitch/controllers/repocallcltes.py, line 12, in repocallcltes grid=SQLFORM.smartgrid(db.cdr, constraints=dict(cdr=query),details=False,create=False,editable=False,deletable=False,csv=False) File /home/fvillarroel/www/web2py/gluon/sqlhtml.py, line 2800, in smartgrid user_signature=user_signature, **kwargs) File /home/fvillarroel/www/web2py/gluon/sqlhtml.py, line 2255, in grid search_menu = SQLFORM.search_menu(sfields, prefix=prefix) File /home/fvillarroel/www/web2py/gluon/sqlhtml.py, line 1709, in search_menu ftype = field.type.split(' ')[0] AttributeError: 'module' object has no attribute 'split' I do not know what i am doing wrong and if i changed smartgrid for sqlform.grid i reveived the same error. Regards -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Call web2py jsonrpc service using jquery
I am trying to make ajax jsonrpc call to my web service using jQuery as given below: $(document).ready(function() { $(#btnNext,#btnPrevious).click(function() { var req = { jsonrpc: 2.0, method: nextprevexample, id: (new Date).getTime() }; req.res = { name: 'aajas' }; $.ajax({ url: http://127.0.0.1:8000/adv01/default/call/jsonrpc;, data: JSON.stringify(req), dataType: json, type: POST, contentType: application/json, success: function(rpcRes) { alert(rpcRes.result); $(#lblexample).text(rpcRes.result[1]); $(#txtexamplereviewed).val(rpcRes.result[1]); }, error: function(err, status, thrown) { alert(thrown); //alert(status);alert(thrown); } }); return false; });}); I am trying to access it in my web2py web service. The code of web service is as follows: @service.json @service.jsonrpcdef nextprevexample(): print request.post_vars exampleid,exampletext=getcorrespondingexample() return exampleid,exampletext But the problem is I don't get anything in post_vars. I tried to search entire request object to find any property which would give me posted data but didn't find one. Please let me know if I have doing anything wrong over here. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Call web2py jsonrpc service using jquery
Have you confirmed that the function is actually getting called? Anything in request.body? Anthony On Thursday, September 4, 2014 12:42:06 AM UTC-4, Gliese 581 g wrote: I am trying to make ajax jsonrpc call to my web service using jQuery as given below: $(document).ready(function() { $(#btnNext,#btnPrevious).click(function() { var req = { jsonrpc: 2.0, method: nextprevexample, id: (new Date).getTime() }; req.res = { name: 'aajas' }; $.ajax({ url: http://127.0.0.1:8000/adv01/default/call/jsonrpc;, data: JSON.stringify(req), dataType: json, type: POST, contentType: application/json, success: function(rpcRes) { alert(rpcRes.result); $(#lblexample).text(rpcRes.result[1]); $(#txtexamplereviewed).val(rpcRes.result[1]); }, error: function(err, status, thrown) { alert(thrown); //alert(status);alert(thrown); } }); return false; });}); I am trying to access it in my web2py web service. The code of web service is as follows: @service.json @service.jsonrpcdef nextprevexample(): print request.post_vars exampleid,exampletext=getcorrespondingexample() return exampleid,exampletext But the problem is I don't get anything in post_vars. I tried to search entire request object to find any property which would give me posted data but didn't find one. Please let me know if I have doing anything wrong over here. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.