[web2py] Re: IMG helper and _width
Massimo, Thanks, problem solved. However, this: {{=IMG(_src=URL(r=request,a='base',c='static',f='base/card/logos/%s' % logo[0].link), _vertical-align=middle)}} .. result in a SyntaxError: keyword can't be an expression According to W3C I should be able to set vertical-align on an img. Kind regards, Annet.
[web2py] CAS not found
The CAS provider applicance should be here. http://mdp.cti.depaul.edu/appliances/default/index (https:// www.web2py.com/cas) https://mdp.cti.depaul.edu/cas (http://en.wikipedia.org/wiki/ Central_Authentication_Service). But I am not able to find it?
Re: [web2py] Re: IMG helper and _width
This is working for me: {{=IMG(_src=URL(r=request,a='base',c='static',f='base/card/logos/%s' % logo[0].link), _style=vertical-align:'middle';)}} 2010/11/10 annet annet.verm...@gmail.com Massimo, Thanks, problem solved. However, this: {{=IMG(_src=URL(r=request,a='base',c='static',f='base/card/logos/%s' % logo[0].link), _vertical-align=middle)}} .. result in a SyntaxError: keyword can't be an expression According to W3C I should be able to set vertical-align on an img. Kind regards, Annet. -- http://rochacbruno.com.br
[web2py] Re: How to switch back to English for the Admin interface?
I know, but I don't want to use one browser for development (English) and one for the rest (German). On 9 Nov., 14:28, mdipierro mdipie...@cs.depaul.edu wrote: wait. You should not need to delete files. The language is set by your browser. On Nov 9, 3:41 am, Stefan Scholl stefan.sch...@gmail.com wrote: Oops, found it 5 minutes later. In case somebody wants to switch back to English, too: Delete (or rename) your language in applications/admin/languages
[web2py] Re: validators order
thank you it is too obvious to see that i made replacement of the validators :) On Nov 4, 10:24 am, DenesL denes1...@yahoo.ca wrote: On Nov 3, 3:52 pm, andrej burja andrej.bu...@gmail.com wrote: hi why is order of validators important? i have db.tecaj.voditelj.requires=IS_NOT_EMPTY() db.tecaj.voditelj.requires=IS_IN_DB(db,'person.id','%(name)s') why does putting the IS_NOT_EMPTY() at the end doesn't produce dropdown list? Your code replaces one validator with another, it does not create a list with both. To have both and get a dropdown you need something like: db.tecaj.voditelj.requires=[IS_NOT_EMPTY(),IS_IN_DB(...)] do i need the IS_NOT_EMPTY() if i have IS_IN_DB validator? It depends on your data and model. In your case it is superfluous because you are storing an id which can not be empty. But if your requires was: IS_IN_DB(db,'person.name') and some entry in person.name was empty then you would need an IS_NOT_EMPTY validator to avoid having an empty entry. andrej
Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte ...
sorry for the stupid question - but how can I call the print data function inside a function that is called through JSONRPC? where will I see the output? in case it helps - I know that at least I get the two fields that I sent, because the last line (where I name them specifically) works. On Tue, Nov 9, 2010 at 21:01, mdipierro mdipie...@cs.depaul.edu wrote: As a debug check. I'd like to see what you gate if you print data before the update. Just in case what you put it in it is not what you get. On Nov 9, 1:25 pm, Omri omri...@gmail.com wrote: in the qooxdoo application, I define data as data = {name: Prüfung, textfield : Etwas mit umlaut- üäüöö} and then send it through an asynchronous call (using qx.io.remote.Rpc.callAsync) On Tue, Nov 9, 2010 at 19:42, mdipierro mdipie...@cs.depaul.edu wrote: can you print data? What is in data? On Nov 9, 12:20 pm, Omri omri...@gmail.com wrote: I did some tryouts and it seems that the only problem is with the update method, and then only when called through service.jsonrpc. I created the following model: db.define_table(debug_stuff, Field(name, length=100), Field(textfield, text), format=%(name)s) and defined the following function in the controller (default): @service.jsonrpc def debug_umlauts(data): # db[debug_stuff].insert(**data) # --- Worked, no problem # db(db[debug_stuff][id] == 2).update(**data) # --- Didn't work db(db[debug_stuff][id] == 2).update(name = data['name'], textfield=data['textfield']) # --- Worked return OK update The only line that didn't work was the second one, where I tried to use the **data for the update method. The problem is that I want the method to be general, and therefore cannot use the method of the third line to specify for .update what fields I'm updating. Thanks, Omri On Nov 8, 5:19 pm, mdipierro mdipie...@cs.depaul.edu wrote: Can you try put a u in front of the string u... On Nov 8, 5:30 am, Omri omri...@gmail.com wrote: Hello, I'm having a unicode problem with the DAL. I'm developing a (mainly) RPC database application with qooxdoo as JS framework and web2py as the webserver. I have created a fairly generic update_record function which simply gets two input variables - a table name and a data dictionary with name/value pairs which correspond to the fields of the table. My function looks like this: def update_record(table_name, data): db(db[table_name]['id'] == data['id']).update(**data) return db(db[table_name]['id'] == data['id']).select() My application should work both in English and in German, and my problem is that when I try to update a string value with an Umlaut (example - Überwlad) I get an error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position... I am able to insert records to the database with Umlauts, but I use a different method for the insert. I use the syntax of .insert(name = value, name2 = value2,...). I tried to encode all the data keys which are unicode objects without success, it keeps raising the same error. Am I missing something here, or is this a bug? And more interestingly, how can it be solved? Thanks, Omri
[web2py] Re: Manipulate Rows Object and/or SQLTABLE
The function looks interesting, but I didnt understand how to create the cols var. def mytable(rows, cols): return TABLE(*[TR(*[TD(row[c]) for c in cols]) for row in rows]) I would be grateful for an example how it might work. I did have this other idea to include an extra column, but I imagine that it's not so elegant as above. rows = db(db.test.id0).select() extras = list() for row in rows: extras.append('whatever') for row,extra in zip(rows,extras): print TR(TD(row.id),TD(extra)) -D On Nov 9, 6:33 pm, mdipierro mdipie...@cs.depaul.edu wrote: I see two options: 1) use db.table.field.represent = lambda value: DIV(value) and give any representation you want to the field value. 2) If this does not work make your own SQLTABLE helper: def mytable(rows, cols): return TABLE(*[TR(*[TD(row[c]) for c in cols]) for row in rows) On Nov 9, 11:36 am, villas villa...@gmail.com wrote: I want to customize the result of SQLTABLE so that it can make me a nice table without lines and lines of code in my view file. To achieve that, I need for example to: 1) Add columns to hold icons and links and extra stuff. 2) Customize the rows, e.g. links which depend on content, different icons etc After giving it some thought, I think I should leave SQLTABLE alone and concentrate on 'improving' the rows object so that it contains everything I want before passing it to SQLTABLE. To do 1) I can simply add a column to the rows object. How can I best do that? To do 2) I could iterate the rows object and make changes. Or maybe there is another way. I appreciate that if I want to style the HTML table, I'll have to write my code in the form (which I am trying to avoid). Thanks, -D
[web2py] Small suggestion regarding auth.add_membership
Hello all, I used auth.add_membership today for the first time, and I realized that the add_membership function adds a membership also if the user already has this membership. Wouldn't it make more sense if the function first uses the has_membership function to check if the user is already a part of the group? Thanks for the great work with web2py! I love it :) Omri
Re: [web2py] Re: IMG helper and _width
Like bruno said, there are no attribute vertical-align in img object, this is css style thing 2010/11/10 Bruno Rocha rochacbr...@gmail.com This is working for me: {{=IMG(_src=URL(r=request,a='base',c='static',f='base/card/logos/%s' % logo[0].link), _style=vertical-align:'middle';)}} 2010/11/10 annet annet.verm...@gmail.com Massimo, Thanks, problem solved. However, this: {{=IMG(_src=URL(r=request,a='base',c='static',f='base/card/logos/%s' % logo[0].link), _vertical-align=middle)}} .. result in a SyntaxError: keyword can't be an expression According to W3C I should be able to set vertical-align on an img. Kind regards, Annet. -- http://rochacbruno.com.br -- My blog: http://martin.tecnodoc.com.ar My portfolio *spanish*: http://www.tecnodoc.com.ar Checkout my last proyect instant-press: http://www.instant2press.com
[web2py] Re: linked tables and dropdown display
does not work, still getting id and no name On Nov 4, 3:59 pm, mdipierro mdipie...@cs.depaul.edu wrote: do this: db.define.table('basic' Field('name1') ...,format='%(name1)s') db.define.table('advanced' Field('name2',db.basic) ...,format='%(name2)s') # db.advanced.name.requires=IS_IN_DB(db,'basic.id','%(name1)s') db.define.table('data' Field('something',db.advanced) ...)
Re: [web2py] Re: Not getting a result from query
Alex, You put me on the right track! Thanks. -- Lorin Rivers Mosasaur: Killer Technical Marketing http://www.mosasaur.com mailto:lriv...@mosasaur.com 512/203.3198 (m)
[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte ...
If you start web2py from the console you should see the output to the console. You can also print to a file or log the output if that makes it easier. On Nov 10, 5:47 am, Omri omri...@gmail.com wrote: sorry for the stupid question - but how can I call the print data function inside a function that is called through JSONRPC? where will I see the output? in case it helps - I know that at least I get the two fields that I sent, because the last line (where I name them specifically) works. On Tue, Nov 9, 2010 at 21:01, mdipierro mdipie...@cs.depaul.edu wrote: As a debug check. I'd like to see what you gate if you print data before the update. Just in case what you put it in it is not what you get. On Nov 9, 1:25 pm, Omri omri...@gmail.com wrote: in the qooxdoo application, I define data as data = {name: Prüfung, textfield : Etwas mit umlaut- üäüöö} and then send it through an asynchronous call (using qx.io.remote.Rpc.callAsync) On Tue, Nov 9, 2010 at 19:42, mdipierro mdipie...@cs.depaul.edu wrote: can you print data? What is in data? On Nov 9, 12:20 pm, Omri omri...@gmail.com wrote: I did some tryouts and it seems that the only problem is with the update method, and then only when called through service.jsonrpc. I created the following model: db.define_table(debug_stuff, Field(name, length=100), Field(textfield, text), format=%(name)s) and defined the following function in the controller (default): @service.jsonrpc def debug_umlauts(data): # db[debug_stuff].insert(**data) # --- Worked, no problem # db(db[debug_stuff][id] == 2).update(**data) # --- Didn't work db(db[debug_stuff][id] == 2).update(name = data['name'], textfield=data['textfield']) # --- Worked return OK update The only line that didn't work was the second one, where I tried to use the **data for the update method. The problem is that I want the method to be general, and therefore cannot use the method of the third line to specify for .update what fields I'm updating. Thanks, Omri On Nov 8, 5:19 pm, mdipierro mdipie...@cs.depaul.edu wrote: Can you try put a u in front of the string u... On Nov 8, 5:30 am, Omri omri...@gmail.com wrote: Hello, I'm having a unicode problem with the DAL. I'm developing a (mainly) RPC database application with qooxdoo as JS framework and web2py as the webserver. I have created a fairly generic update_record function which simply gets two input variables - a table name and a data dictionary with name/value pairs which correspond to the fields of the table. My function looks like this: def update_record(table_name, data): db(db[table_name]['id'] == data['id']).update(**data) return db(db[table_name]['id'] == data['id']).select() My application should work both in English and in German, and my problem is that when I try to update a string value with an Umlaut (example - Überwlad) I get an error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position... I am able to insert records to the database with Umlauts, but I use a different method for the insert. I use the syntax of .insert(name = value, name2 = value2,...). I tried to encode all the data keys which are unicode objects without success, it keeps raising the same error. Am I missing something here, or is this a bug? And more interestingly, how can it be solved? Thanks, Omri
[web2py] Re: Small suggestion regarding auth.add_membership
yes. In trunk, please check it. On Nov 10, 5:52 am, Omri omri...@gmail.com wrote: Hello all, I used auth.add_membership today for the first time, and I realized that the add_membership function adds a membership also if the user already has this membership. Wouldn't it make more sense if the function first uses the has_membership function to check if the user is already a part of the group? Thanks for the great work with web2py! I love it :) Omri
[web2py] Re: CAS not found
Has moved http://web2py.com/cas On Nov 10, 6:46 am, notabene niels...@gmail.com wrote: The CAS provider applicance should be here.http://mdp.cti.depaul.edu/appliances/default/index (https://www.web2py.com/cas)https://mdp.cti.depaul.edu/cas(http://en.wikipedia.org/wiki/ Central_Authentication_Service). But I am not able to find it?
[web2py] Re: Manipulate Rows Object and/or SQLTABLE
If all you need is an extra column have a look at col3 in SQLFORM http://web2py.com/book/default/chapter/07#SQLFORM On Nov 10, 5:33 am, villas villa...@gmail.com wrote: The function looks interesting, but I didnt understand how to create the cols var. def mytable(rows, cols): return TABLE(*[TR(*[TD(row[c]) for c in cols]) for row in rows]) I would be grateful for an example how it might work. I did have this other idea to include an extra column, but I imagine that it's not so elegant as above. rows = db(db.test.id0).select() extras = list() for row in rows: extras.append('whatever') for row,extra in zip(rows,extras): print TR(TD(row.id),TD(extra)) -D On Nov 9, 6:33 pm, mdipierro mdipie...@cs.depaul.edu wrote: I see two options: 1) use db.table.field.represent = lambda value: DIV(value) and give any representation you want to the field value. 2) If this does not work make your own SQLTABLE helper: def mytable(rows, cols): return TABLE(*[TR(*[TD(row[c]) for c in cols]) for row in rows) On Nov 9, 11:36 am, villas villa...@gmail.com wrote: I want to customize the result of SQLTABLE so that it can make me a nice table without lines and lines of code in my view file. To achieve that, I need for example to: 1) Add columns to hold icons and links and extra stuff. 2) Customize the rows, e.g. links which depend on content, different icons etc After giving it some thought, I think I should leave SQLTABLE alone and concentrate on 'improving' the rows object so that it contains everything I want before passing it to SQLTABLE. To do 1) I can simply add a column to the rows object. How can I best do that? To do 2) I could iterate the rows object and make changes. Or maybe there is another way. I appreciate that if I want to style the HTML table, I'll have to write my code in the form (which I am trying to avoid). Thanks, -D
[web2py] Re: Plugin_JqGrid long-polling
Sorry I did not help. I cannot help you because the code you have above is incomplete. It opens a but never closes so I not understand how callback is used. Anyway I assume in the view you have: {{callback = URL(r=request,c='plugin_jqgrid',f='data', vars=dict(tablename=table._tablename, columns=','.join(columns), fieldname=fieldname or '', fieldvalue=fieldvalue, ))}} var server_time=test ... jQuery.getJSON('{{=callback}} 'server_time='+escape(server_time)) ... hope this helps. On Nov 10, 8:24 am, AsmanCom d.as...@web.de wrote: Is there no solution to my concerns? It´s such a pity...
[web2py] Re: Error Installing Appliance
If you are using Windows, can you please try the web2py binary distribution. Personally I have never used web2py with ActiveState Python and I cannot exclude some quirks with it. On Nov 10, 7:31 am, Syed syed.f.ka...@gmail.com wrote: Apologies for what will probably be a complete noob-error. I just tried installing Instant Press through the web2py admin and received the error. This is what I did on my Windows 7 machine running the x64 OS. 1. Downloaded and installed Python 2.5.5.7 (x86) from ActiveState 2. Downloaded and installed web2py 3. Downloaded Instant Press Beta5 from code.google.com I then started web2py and pulled up the admin site. I named the package using Upload install packed application, located on the right-side of the page and fourth box from the top. I chose the zipped- package from my desktop, named it instant_press, and then clicked install. I then received the following error: unable to install application instant_press Am I doing something wrong?
[web2py] Re: error with uploadfield and blob
bug. Fixed in trunk. Sorry it took so long. On Nov 8, 10:38 pm, richard.ree richard.h@gmail.com wrote: I want to upload a file and store it in a blob field: db.define_table( data, Field(citation, string, required=True, notnull=True), Field(datafile, upload, uploadfield=data), Field(data, blob), ) But if I insert a record (through SQLFORM or admin) but leave the datafile field empty, i.e., I input a citation but not a file, I get this error: web2py Version 1.88.2 (2010-10-29 23:04:43) Traceback (most recent call last): File /home/rree/web2py/gluon/restricted.py, line 188, in restricted exec ccode in environment File /home/rree/web2py/applications/mytest/controllers/ appadmin.py, line 410, in module File /home/rree/web2py/gluon/globals.py, line 96, in lambda self._caller = lambda f: f() File /home/rree/web2py/applications/mytest/controllers/ appadmin.py, line 125, in insert if form.accepts(request.vars, session): File /home/rree/web2py/gluon/sqlhtml.py, line 1105, in accepts value = fields[fieldname] KeyError: 'data' How to make the upload field optional? Thanks -Rick
[web2py] Re: Upload a file to db and store all metadata to separated db fields
def Upload(): from gluon.contenttype import contenttype import os, stat form=SQLFORM(db.image) if form.accepts(request.vars, session): file_handler = request.vars.pic ### this if a cgi.FieldStorage file_path = os.path.join(request.folder, 'uploads/',form.vars.pic) raw_file_size = file_handler.?file_size() MIME_Version = ?get_MIME() Content_ID= file_handler.?file_handler() Content_Type = file_handler.?file_type() file_header = ?get_Phys_File_Header(file_handler) db(db.image.id==form.vars.id).update( physical_file_name = file_path, file_extension = file_path.split('.')[-1], file_size = os.stat(file_path)[stat.ST_SIZE], Content_Type = contenttype(file_name), MIME_Version = ? Content_ID = ?, file_header = ?, ) response.flash = 'File Uploaded' return dict(form=form) I fixed some. Not all because I am not sure what those fields should contain. On Nov 9, 3:52 pm, Alexandre Augusto alllme...@gmail.com wrote: Hi Massimo and Cesar. First of all another one zillion thxz to the Extremely Amazing Framework ever created ! I have a sittuation that is not the same as Cesar:http://groups.google.com/group/web2py/browse_thread/thread/c83cd69dee... but somehow it is related.. and I did spent like 6 days trying many things and I could not make it right... hope you could help me out.. and maybe this solves many others problems... *In a nut shell, I'm trying to upload the file, store it on the database (using the two fields upload and blob ), and save all meta-data and common information to different fields on the same record * *By meta-data I refer to file Mime types* 1. MIME-Version 2. Content-ID 3. Content-Type [ 4. File header signature, extracted from the file first data block -- not sure one of the 3 fields above provide this incase not ] *and common infomation* I mean all user information that could be associated to the file: 5. Full file name ( 'C:\My Documents\pics\agape.jpg' ) 6. File Extension ( '.jpg' ) 7. File Size ( ' 230 kb ' ) n. ...or any other metadata information available for the file I could make the upload/ and blob/ work but I'm not having success to gather and extract this information from the file at the same time I'm uploading and storing it on the DB.. This is for my Computer Science Bachelor Graduation Work at Unip, São Paulo University, once i get it more mature I'm going to release it to the community, as I'm aiming to create an Open Source Project similar what happened to Instant Press but on a different scope application some sort of ECM tool.. Even being aware that may not be wise to store all these and some could be derivative from other fields, I need to make this work for the proof of concept to develop other concepts in the project. So my model is like this # Model db.define_table(image, Field('pic','upload',default=''), Field('file','upload', default=, autodelete=True, uploadfield='file_binary_data') , Field('file_binary_data', 'blob'), Field('physical_file_name'), # the full file name.. is it possible grab the folder from where it was uploaded ? Field('file_extension'), Field('file_size'), Field('MIME_Version'), Field('Content_ID'), Field('Content_Type'), Field('file_header'), #File header footprint extracted from X top chars from file ) #Controller def Upload(): form=SQLFORM(db.image) if form.accepts(request.vars, session): file_name = request.vars.pic try: ext = re.compile('\.\w+ $').findall(file_name.filename.strip())[0] except IndexError: ext = '.txt' #pic_filename = 'image.'+'pic.'+str(random.random())[2:] + ext #pic_filename = 'image.'+'pic.' + str(uuid.uuid4()).replace('-','') + ext #pic_filename = pic.filename file_path = os.path.join(request.folder, 'uploads/', file_name) file_handler = open(file_path,'wb') file_handler.close() raw_file_size = file_handler.?file_size() MIME_Version = ?get_MIME() Content_ID = file_handler.?file_handler() Content_Type = file_handler.?file_type() file_header = ?get_Phys_File_Header(file_handler) image_id = db.image.insert( pic = file_name.uuid64 , file_binary_data = file_name , physical_file_name = file_path , file_extension = ext , file_size = raw_file_size , MIME_Version = MIME_Version , Content_ID = Content_ID , Content_Type = Content_Type , file_header = file_header , ) response.flash = 'File Uploaded' return dict(form=form) ### I tried to
[web2py] Re: Error Installing Appliance
I'll make sure that all variables are removed from the equation.--I'll uninstall everything and that start from scratch with 2.5.5 from python.org. And then I'll be sure to try the binary distribution. I'll report back with the results. Thanks.
[web2py] Re: Plugin_JqGrid long-polling
Hi Massimo, never mind. I do not want the variable passed with jQuery.getJSON, but with the url: '% (callback) s', which is called with LoadComplete: .trigger (reload grid). Here's the code so far.. _ app/models/plugin_jqgrid.py: def plugin_live_grid(table,fieldname=None,fieldvalue=None,col_widths={}, _id=None,columns=None,col_width=80,width=700,height=300): just do to embed the jqGrid with ajax search capability and pagination {{=plugin_jqgrid(db.tablename)}} - table is the db.tablename - fieldname, fieldvalue are an optional filter (fieldname==fieldvalue) - _id is the id of the DIV that contains the jqGrid - columns is a list of columns names to be displayed - cold_width is the width of each column - height is the height of the jqGrid from gluon.serializers import json _id = 'jqgrid_%s' % table columns = columns or [x for x in table.fields if table[x].readable] colnames = [x.replace('_',' ').capitalize() for x in columns] colmodel = [{'name':x,'index':x, 'width':col_widths.get(x,col_width), 'sortable':True} \ for x in columns if table[x].readable] callback = URL(r=request,c='plugin_jqgrid',f='data', vars=dict(tablename=table._tablename, columns=','.join(columns), fieldname=fieldname or '', fieldvalue=fieldvalue, )) script= var server_time=null; jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', datatype: json, colNames: %(colnames)s, colModel:%(colmodel)s, rowNum:10, rowList:[20,50,100], pager: '#%(id)s_pager', onSelectRow: function(postdata) {web2py_ajax_page('get','/jqgrid2/ default/tabs2/'+(postdata),null,'panel');}, loadComplete: function () { var server_time=jQuery(#%(id)s).getGridParam('userData'); setTimeout(function(){ alert(server_time); jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 1000); /* 1000..after 1 seconds */ }, loadError: function () { setTimeout(function(){ jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 15000); /* milliseconds (15seconds) */ }, caption:'%(tablename)s', viewrecords: true, height:%(height)s, loadui:disabled}); jQuery(#%(id)s).jqGrid('navGrid','#%(id)s_pager', {search:true,add:false,edit:false,del:false}); jQuery(#%(id)s).setGridWidth(%(width)s,false);}); % dict(callback=callback,colnames=json(colnames), tablename=table._tablename.capitalize(), colmodel=json(colmodel),id=_id,height=height,width=width) return TAG[''](TABLE(_id=_id), DIV(_id=_id+_pager), SCRIPT(script)) ___ app/controllers/plugin_jqgrid.py: from random import randint from time import sleep def error(): raise HTTP(400) def data2():# for testing if randint(1,3) == 1: raise HTTP(400) else: return data2() def data(): sleep(10) # for testing http://trirand.com/blog/jqgrid/server.php? q=1_search=falsend=1267835445772rows=10page=1sidx=amountsord=ascsearchField=searchString=searchOper= from gluon.serializers import json import cgi tablename = request.vars.tablename or error() columns = (request.vars.columns or error()).split(',') rows=int(request.vars.rows or 25) page=int(request.vars.page or 0) sidx=request.vars.sidx or 'id' sord=request.vars.sord or 'asc' searchField=request.vars.searchField searchString=request.vars.searchString searchOper={'eq':lambda a,b: a==b, 'nq':lambda a,b: a!=b, 'gt':lambda a,b: ab, 'ge':lambda a,b: a=b, 'lt':lambda a,b: ab, 'le':lambda a,b: a=b, 'bw':lambda a,b: a.like(b+'%'), 'bn':lambda a,b: ~a.like(b+'%'), 'ew':lambda a,b: a.like('%'+b), 'en':lambda a,b: ~a.like('%'+b), 'cn':lambda a,b: a.like('%'+b+'%'), 'nc':lambda a,b: ~a.like('%'+b+'%'), 'in':lambda a,b: a.belongs(b.split()), 'ni':lambda a,b: ~a.belongs(b.split())}\ [request.vars.searchOper or 'eq'] table=db[tablename] if request.vars.fieldname: dbset = table._db(table[request.vars.fieldname]==request.vars.fieldvalue) else: dbset = table._db(table.id0) if searchField: dbset=dbset(searchOper(table[searchField],searchString)) orderby = table[sidx] if sord=='desc': orderby=~orderby limitby=(rows*(page-1),rows*page) fields = [table[f] for f in columns] records = dbset.select(orderby=orderby,limitby=limitby,*fields) nrecords = dbset.count() items = {}
[web2py] Re: Plugin_JqGrid long-polling
replace jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', with jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)sserver_time'+escape(server_time), On Nov 10, 9:34 am, AsmanCom d.as...@web.de wrote: Hi Massimo, never mind. I do not want the variable passed with jQuery.getJSON, but with the url: '% (callback) s', which is called with LoadComplete: .trigger (reload grid). Here's the code so far.. _ app/models/plugin_jqgrid.py: def plugin_live_grid(table,fieldname=None,fieldvalue=None,col_widths={}, _id=None,columns=None,col_width=80,width=700,height=300): just do to embed the jqGrid with ajax search capability and pagination {{=plugin_jqgrid(db.tablename)}} - table is the db.tablename - fieldname, fieldvalue are an optional filter (fieldname==fieldvalue) - _id is the id of the DIV that contains the jqGrid - columns is a list of columns names to be displayed - cold_width is the width of each column - height is the height of the jqGrid from gluon.serializers import json _id = 'jqgrid_%s' % table columns = columns or [x for x in table.fields if table[x].readable] colnames = [x.replace('_',' ').capitalize() for x in columns] colmodel = [{'name':x,'index':x, 'width':col_widths.get(x,col_width), 'sortable':True} \ for x in columns if table[x].readable] callback = URL(r=request,c='plugin_jqgrid',f='data', vars=dict(tablename=table._tablename, columns=','.join(columns), fieldname=fieldname or '', fieldvalue=fieldvalue, )) script= var server_time=null; jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', datatype: json, colNames: %(colnames)s, colModel:%(colmodel)s, rowNum:10, rowList:[20,50,100], pager: '#%(id)s_pager', onSelectRow: function(postdata) {web2py_ajax_page('get','/jqgrid2/ default/tabs2/'+(postdata),null,'panel');}, loadComplete: function () { var server_time=jQuery(#%(id)s).getGridParam('userData'); setTimeout(function(){ alert(server_time); jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 1000); /* 1000..after 1 seconds */ }, loadError: function () { setTimeout(function(){ jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 15000); /* milliseconds (15seconds) */ }, caption:'%(tablename)s', viewrecords: true, height:%(height)s, loadui:disabled}); jQuery(#%(id)s).jqGrid('navGrid','#%(id)s_pager', {search:true,add:false,edit:false,del:false}); jQuery(#%(id)s).setGridWidth(%(width)s,false);}); % dict(callback=callback,colnames=json(colnames), tablename=table._tablename.capitalize(), colmodel=json(colmodel),id=_id,height=height,width=width) return TAG[''](TABLE(_id=_id), DIV(_id=_id+_pager), SCRIPT(script)) ___ app/controllers/plugin_jqgrid.py: from random import randint from time import sleep def error(): raise HTTP(400) def data2():# for testing if randint(1,3) == 1: raise HTTP(400) else: return data2() def data(): sleep(10) # for testing http://trirand.com/blog/jqgrid/server.php? q=1_search=falsend=1267835445772rows=10page=1sidx=amountsord=ascsearchField=searchString=searchOper= from gluon.serializers import json import cgi tablename = request.vars.tablename or error() columns = (request.vars.columns or error()).split(',') rows=int(request.vars.rows or 25) page=int(request.vars.page or 0) sidx=request.vars.sidx or 'id' sord=request.vars.sord or 'asc' searchField=request.vars.searchField searchString=request.vars.searchString searchOper={'eq':lambda a,b: a==b, 'nq':lambda a,b: a!=b, 'gt':lambda a,b: ab, 'ge':lambda a,b: a=b, 'lt':lambda a,b: ab, 'le':lambda a,b: a=b, 'bw':lambda a,b: a.like(b+'%'), 'bn':lambda a,b: ~a.like(b+'%'), 'ew':lambda a,b: a.like('%'+b), 'en':lambda a,b: ~a.like('%'+b), 'cn':lambda a,b: a.like('%'+b+'%'), 'nc':lambda a,b: ~a.like('%'+b+'%'), 'in':lambda a,b: a.belongs(b.split()), 'ni':lambda a,b: ~a.belongs(b.split())}\ [request.vars.searchOper or 'eq'] table=db[tablename] if request.vars.fieldname: dbset =
[web2py] Re: Error Installing Appliance
Note, if you use the web2py binary, it includes Python (2.5, I think), so you don't need to install Python separately. If you want to install your own Python, then you can run web2py from source on Windows (make sure your Python installation directory is in your Windows PATH variable). If installing your own Python, you'll also want this: http://sourceforge.net/projects/pywin32/ Also, you should be able to run Python 2.6 or 2.7 with web2py, so you don't have to stick with 2.5. Anthony On Nov 10, 10:05 am, Syed syed.f.ka...@gmail.com wrote: I'll make sure that all variables are removed from the equation.--I'll uninstall everything and that start from scratch with 2.5.5 from python.org. And then I'll be sure to try the binary distribution. I'll report back with the results. Thanks.
[web2py] help us test new admin on windows....
download the windows binary (nightly built) from http://web2py.com/examples/default/download with FF and IE, try admin, try create a new app and edit a file, report any problem.
[web2py] Re: Plugin_JqGrid long-polling
tried it like this: app/models/plugin_jqgrid.py: var server_time=null; jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)sserver_time'+escape(server_time), app/controllers/plugin_jqgrid.py: def data(): sleep(10) ... test1 = request.vars.server_time or error() tablename = request.vars.tablename or error() ... items = {} items['userdata']=request.now ... __ It seems not working, data is not returned by the controller. On 10 Nov., 16:37, mdipierro mdipie...@cs.depaul.edu wrote: replace jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', with jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)sserver_time'+escape(server_time), On Nov 10, 9:34 am, AsmanCom d.as...@web.de wrote: Hi Massimo, never mind. I do not want the variable passed with jQuery.getJSON, but with the url: '% (callback) s', which is called with LoadComplete: .trigger (reload grid). Here's the code so far.. _ app/models/plugin_jqgrid.py: def plugin_live_grid(table,fieldname=None,fieldvalue=None,col_widths={}, _id=None,columns=None,col_width=80,width=700,height=300): just do to embed the jqGrid with ajax search capability and pagination {{=plugin_jqgrid(db.tablename)}} - table is the db.tablename - fieldname, fieldvalue are an optional filter (fieldname==fieldvalue) - _id is the id of the DIV that contains the jqGrid - columns is a list of columns names to be displayed - cold_width is the width of each column - height is the height of the jqGrid from gluon.serializers import json _id = 'jqgrid_%s' % table columns = columns or [x for x in table.fields if table[x].readable] colnames = [x.replace('_',' ').capitalize() for x in columns] colmodel = [{'name':x,'index':x, 'width':col_widths.get(x,col_width), 'sortable':True} \ for x in columns if table[x].readable] callback = URL(r=request,c='plugin_jqgrid',f='data', vars=dict(tablename=table._tablename, columns=','.join(columns), fieldname=fieldname or '', fieldvalue=fieldvalue, )) script= var server_time=null; jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', datatype: json, colNames: %(colnames)s, colModel:%(colmodel)s, rowNum:10, rowList:[20,50,100], pager: '#%(id)s_pager', onSelectRow: function(postdata) {web2py_ajax_page('get','/jqgrid2/ default/tabs2/'+(postdata),null,'panel');}, loadComplete: function () { var server_time=jQuery(#%(id)s).getGridParam('userData'); setTimeout(function(){ alert(server_time); jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 1000); /* 1000..after 1 seconds */ }, loadError: function () { setTimeout(function(){ jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 15000); /* milliseconds (15seconds) */ }, caption:'%(tablename)s', viewrecords: true, height:%(height)s, loadui:disabled}); jQuery(#%(id)s).jqGrid('navGrid','#%(id)s_pager', {search:true,add:false,edit:false,del:false}); jQuery(#%(id)s).setGridWidth(%(width)s,false);}); % dict(callback=callback,colnames=json(colnames), tablename=table._tablename.capitalize(), colmodel=json(colmodel),id=_id,height=height,width=width) return TAG[''](TABLE(_id=_id), DIV(_id=_id+_pager), SCRIPT(script)) ___ app/controllers/plugin_jqgrid.py: from random import randint from time import sleep def error(): raise HTTP(400) def data2():# for testing if randint(1,3) == 1: raise HTTP(400) else: return data2() def data(): sleep(10) # for testing http://trirand.com/blog/jqgrid/server.php? q=1_search=falsend=1267835445772rows=10page=1sidx=amountsord=ascsearchField=searchString=searchOper= from gluon.serializers import json import cgi tablename = request.vars.tablename or error() columns = (request.vars.columns or error()).split(',') rows=int(request.vars.rows or 25) page=int(request.vars.page or 0) sidx=request.vars.sidx or 'id' sord=request.vars.sord or 'asc' searchField=request.vars.searchField searchString=request.vars.searchString searchOper={'eq':lambda a,b: a==b, 'nq':lambda a,b: a!=b, 'gt':lambda a,b:
[web2py] Re: Plugin_JqGrid long-polling
You need to install firebug and check in the console log what is going on. On Nov 10, 9:53 am, AsmanCom d.as...@web.de wrote: tried it like this: app/models/plugin_jqgrid.py: var server_time=null; jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)sserver_time'+escape(server_time), app/controllers/plugin_jqgrid.py: def data(): sleep(10) ... test1 = request.vars.server_time or error() tablename = request.vars.tablename or error() ... items = {} items['userdata']=request.now ... __ It seems not working, data is not returned by the controller. On 10 Nov., 16:37, mdipierro mdipie...@cs.depaul.edu wrote: replace jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', with jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)sserver_time'+escape(server_time), On Nov 10, 9:34 am, AsmanCom d.as...@web.de wrote: Hi Massimo, never mind. I do not want the variable passed with jQuery.getJSON, but with the url: '% (callback) s', which is called with LoadComplete: .trigger (reload grid). Here's the code so far.. _ app/models/plugin_jqgrid.py: def plugin_live_grid(table,fieldname=None,fieldvalue=None,col_widths={}, _id=None,columns=None,col_width=80,width=700,height=300): just do to embed the jqGrid with ajax search capability and pagination {{=plugin_jqgrid(db.tablename)}} - table is the db.tablename - fieldname, fieldvalue are an optional filter (fieldname==fieldvalue) - _id is the id of the DIV that contains the jqGrid - columns is a list of columns names to be displayed - cold_width is the width of each column - height is the height of the jqGrid from gluon.serializers import json _id = 'jqgrid_%s' % table columns = columns or [x for x in table.fields if table[x].readable] colnames = [x.replace('_',' ').capitalize() for x in columns] colmodel = [{'name':x,'index':x, 'width':col_widths.get(x,col_width), 'sortable':True} \ for x in columns if table[x].readable] callback = URL(r=request,c='plugin_jqgrid',f='data', vars=dict(tablename=table._tablename, columns=','.join(columns), fieldname=fieldname or '', fieldvalue=fieldvalue, )) script= var server_time=null; jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', datatype: json, colNames: %(colnames)s, colModel:%(colmodel)s, rowNum:10, rowList:[20,50,100], pager: '#%(id)s_pager', onSelectRow: function(postdata) {web2py_ajax_page('get','/jqgrid2/ default/tabs2/'+(postdata),null,'panel');}, loadComplete: function () { var server_time=jQuery(#%(id)s).getGridParam('userData'); setTimeout(function(){ alert(server_time); jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 1000); /* 1000..after 1 seconds */ }, loadError: function () { setTimeout(function(){ jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 15000); /* milliseconds (15seconds) */ }, caption:'%(tablename)s', viewrecords: true, height:%(height)s, loadui:disabled}); jQuery(#%(id)s).jqGrid('navGrid','#%(id)s_pager', {search:true,add:false,edit:false,del:false}); jQuery(#%(id)s).setGridWidth(%(width)s,false);}); % dict(callback=callback,colnames=json(colnames), tablename=table._tablename.capitalize(), colmodel=json(colmodel),id=_id,height=height,width=width) return TAG[''](TABLE(_id=_id), DIV(_id=_id+_pager), SCRIPT(script)) ___ app/controllers/plugin_jqgrid.py: from random import randint from time import sleep def error(): raise HTTP(400) def data2():# for testing if randint(1,3) == 1: raise HTTP(400) else: return data2() def data(): sleep(10) # for testing http://trirand.com/blog/jqgrid/server.php? q=1_search=falsend=1267835445772rows=10page=1sidx=amountsord=ascsearchField=searchString=searchOper= from gluon.serializers import json import cgi tablename = request.vars.tablename or error() columns = (request.vars.columns or error()).split(',') rows=int(request.vars.rows or 25) page=int(request.vars.page or 0)
[web2py] cas incorrect address in email
Hi, CAS return this incorrect address in email https://mdp.cti.depaul.edu/cas/cas/verify?id=191key=d1c373ab1570cfb9a7dbb53c186b37a2 It must be https://www.web2py.com/cas/cas/verify?id=191key=d1c373ab1570cfb9a7dbb53c186b37a2 What can I do to correct it. There is a CAS application downloadable? Thanks leone
[web2py] Re: Plugin_JqGrid long-polling
By the way, how can i set initially the var server_time=null; to a python readble False? THX On 10 Nov., 16:55, mdipierro mdipie...@cs.depaul.edu wrote: You need to install firebug and check in the console log what is going on. On Nov 10, 9:53 am, AsmanCom d.as...@web.de wrote: tried it like this: app/models/plugin_jqgrid.py: var server_time=null; jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)sserver_time'+escape(server_time), app/controllers/plugin_jqgrid.py: def data(): sleep(10) ... test1 = request.vars.server_time or error() tablename = request.vars.tablename or error() ... items = {} items['userdata']=request.now ... __ It seems not working, data is not returned by the controller. On 10 Nov., 16:37, mdipierro mdipie...@cs.depaul.edu wrote: replace jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', with jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)sserver_time'+escape(server_time), On Nov 10, 9:34 am, AsmanCom d.as...@web.de wrote: Hi Massimo, never mind. I do not want the variable passed with jQuery.getJSON, but with the url: '% (callback) s', which is called with LoadComplete: .trigger (reload grid). Here's the code so far.. _ app/models/plugin_jqgrid.py: def plugin_live_grid(table,fieldname=None,fieldvalue=None,col_widths={}, _id=None,columns=None,col_width=80,width=700,height=300): just do to embed the jqGrid with ajax search capability and pagination {{=plugin_jqgrid(db.tablename)}} - table is the db.tablename - fieldname, fieldvalue are an optional filter (fieldname==fieldvalue) - _id is the id of the DIV that contains the jqGrid - columns is a list of columns names to be displayed - cold_width is the width of each column - height is the height of the jqGrid from gluon.serializers import json _id = 'jqgrid_%s' % table columns = columns or [x for x in table.fields if table[x].readable] colnames = [x.replace('_',' ').capitalize() for x in columns] colmodel = [{'name':x,'index':x, 'width':col_widths.get(x,col_width), 'sortable':True} \ for x in columns if table[x].readable] callback = URL(r=request,c='plugin_jqgrid',f='data', vars=dict(tablename=table._tablename, columns=','.join(columns), fieldname=fieldname or '', fieldvalue=fieldvalue, )) script= var server_time=null; jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', datatype: json, colNames: %(colnames)s, colModel:%(colmodel)s, rowNum:10, rowList:[20,50,100], pager: '#%(id)s_pager', onSelectRow: function(postdata) {web2py_ajax_page('get','/jqgrid2/ default/tabs2/'+(postdata),null,'panel');}, loadComplete: function () { var server_time=jQuery(#%(id)s).getGridParam('userData'); setTimeout(function(){ alert(server_time); jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 1000); /* 1000..after 1 seconds */ }, loadError: function () { setTimeout(function(){ jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 15000); /* milliseconds (15seconds) */ }, caption:'%(tablename)s', viewrecords: true, height:%(height)s, loadui:disabled}); jQuery(#%(id)s).jqGrid('navGrid','#%(id)s_pager', {search:true,add:false,edit:false,del:false}); jQuery(#%(id)s).setGridWidth(%(width)s,false);}); % dict(callback=callback,colnames=json(colnames), tablename=table._tablename.capitalize(), colmodel=json(colmodel),id=_id,height=height,width=width) return TAG[''](TABLE(_id=_id), DIV(_id=_id+_pager), SCRIPT(script)) ___ app/controllers/plugin_jqgrid.py: from random import randint from time import sleep def error(): raise HTTP(400) def data2():# for testing if randint(1,3) == 1: raise HTTP(400) else: return data2() def data(): sleep(10) # for testing http://trirand.com/blog/jqgrid/server.php? q=1_search=falsend=1267835445772rows=10page=1sidx=amountsord=ascsearchField=searchString=searchOper=
Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte ...
I should have thought about that.. the result from the print data function is: {u'textfield': u'Viele Umlauts: \xe4\xe4\xe4\xfc\xfc\xfc\xdc\xdc\xdc\xd6\xd6\xd6\xe4\xe4\xe4', u'name': u'\xdcberprufen'} for the following data sent: data = { name : Überprufen, textfield : Viele Umlauts: äääüüüÜÜÜÖÖÖäää } On Wed, Nov 10, 2010 at 15:23, mdipierro mdipie...@cs.depaul.edu wrote: If you start web2py from the console you should see the output to the console. You can also print to a file or log the output if that makes it easier. On Nov 10, 5:47 am, Omri omri...@gmail.com wrote: sorry for the stupid question - but how can I call the print data function inside a function that is called through JSONRPC? where will I see the output? in case it helps - I know that at least I get the two fields that I sent, because the last line (where I name them specifically) works. On Tue, Nov 9, 2010 at 21:01, mdipierro mdipie...@cs.depaul.edu wrote: As a debug check. I'd like to see what you gate if you print data before the update. Just in case what you put it in it is not what you get. On Nov 9, 1:25 pm, Omri omri...@gmail.com wrote: in the qooxdoo application, I define data as data = {name: Prüfung, textfield : Etwas mit umlaut- üäüöö} and then send it through an asynchronous call (using qx.io.remote.Rpc.callAsync) On Tue, Nov 9, 2010 at 19:42, mdipierro mdipie...@cs.depaul.edu wrote: can you print data? What is in data? On Nov 9, 12:20 pm, Omri omri...@gmail.com wrote: I did some tryouts and it seems that the only problem is with the update method, and then only when called through service.jsonrpc. I created the following model: db.define_table(debug_stuff, Field(name, length=100), Field(textfield, text), format=%(name)s) and defined the following function in the controller (default): @service.jsonrpc def debug_umlauts(data): # db[debug_stuff].insert(**data) # --- Worked, no problem # db(db[debug_stuff][id] == 2).update(**data) # --- Didn't work db(db[debug_stuff][id] == 2).update(name = data['name'], textfield=data['textfield']) # --- Worked return OK update The only line that didn't work was the second one, where I tried to use the **data for the update method. The problem is that I want the method to be general, and therefore cannot use the method of the third line to specify for .update what fields I'm updating. Thanks, Omri On Nov 8, 5:19 pm, mdipierro mdipie...@cs.depaul.edu wrote: Can you try put a u in front of the string u... On Nov 8, 5:30 am, Omri omri...@gmail.com wrote: Hello, I'm having a unicode problem with the DAL. I'm developing a (mainly) RPC database application with qooxdoo as JS framework and web2py as the webserver. I have created a fairly generic update_record function which simply gets two input variables - a table name and a data dictionary with name/value pairs which correspond to the fields of the table. My function looks like this: def update_record(table_name, data): db(db[table_name]['id'] == data['id']).update(**data) return db(db[table_name]['id'] == data['id']).select() My application should work both in English and in German, and my problem is that when I try to update a string value with an Umlaut (example - Überwlad) I get an error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position... I am able to insert records to the database with Umlauts, but I use a different method for the insert. I use the syntax of .insert(name = value, name2 = value2,...). I tried to encode all the data keys which are unicode objects without success, it keeps raising the same error. Am I missing something here, or is this a bug? And more interestingly, how can it be solved? Thanks, Omri
[web2py] Re: Plugin_JqGrid long-polling
http://127.0.0.1:8000/core/plugin_jqgrid/data?fieldname=tablename=devicefieldvalue=Nonecolumns=id%2Ccolumn1%2Ccolumn2%2Ccolumn3%2Ccolumn4%2Ccolumn5%2Ccolumn6%2Ccolumn7%2Ccolumn8%2Ccolumn9%2Ccolumn10server_timenull_search=falsend=1289404767209rows=10page=1sidx=sord=asc Parameter: _search false columns id,column1,column2,column3,column4,column5,column6,column7,column8,column9,column10 fieldname fieldvalue None nd 1289404767209 page1 rows10 server_timenull sidx sordasc tablename device server_timenull seems wrong? what to do? THX On 10 Nov., 16:55, mdipierro mdipie...@cs.depaul.edu wrote: You need to install firebug and check in the console log what is going on. On Nov 10, 9:53 am, AsmanCom d.as...@web.de wrote: tried it like this: app/models/plugin_jqgrid.py: var server_time=null; jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)sserver_time'+escape(server_time), app/controllers/plugin_jqgrid.py: def data(): sleep(10) ... test1 = request.vars.server_time or error() tablename = request.vars.tablename or error() ... items = {} items['userdata']=request.now ... __ It seems not working, data is not returned by the controller. On 10 Nov., 16:37, mdipierro mdipie...@cs.depaul.edu wrote: replace jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', with jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)sserver_time'+escape(server_time), On Nov 10, 9:34 am, AsmanCom d.as...@web.de wrote: Hi Massimo, never mind. I do not want the variable passed with jQuery.getJSON, but with the url: '% (callback) s', which is called with LoadComplete: .trigger (reload grid). Here's the code so far.. _ app/models/plugin_jqgrid.py: def plugin_live_grid(table,fieldname=None,fieldvalue=None,col_widths={}, _id=None,columns=None,col_width=80,width=700,height=300): just do to embed the jqGrid with ajax search capability and pagination {{=plugin_jqgrid(db.tablename)}} - table is the db.tablename - fieldname, fieldvalue are an optional filter (fieldname==fieldvalue) - _id is the id of the DIV that contains the jqGrid - columns is a list of columns names to be displayed - cold_width is the width of each column - height is the height of the jqGrid from gluon.serializers import json _id = 'jqgrid_%s' % table columns = columns or [x for x in table.fields if table[x].readable] colnames = [x.replace('_',' ').capitalize() for x in columns] colmodel = [{'name':x,'index':x, 'width':col_widths.get(x,col_width), 'sortable':True} \ for x in columns if table[x].readable] callback = URL(r=request,c='plugin_jqgrid',f='data', vars=dict(tablename=table._tablename, columns=','.join(columns), fieldname=fieldname or '', fieldvalue=fieldvalue, )) script= var server_time=null; jQuery(document).ready(function(server_time){jQuery(#% (id)s).jqGrid({ url:'%(callback)s', datatype: json, colNames: %(colnames)s, colModel:%(colmodel)s, rowNum:10, rowList:[20,50,100], pager: '#%(id)s_pager', onSelectRow: function(postdata) {web2py_ajax_page('get','/jqgrid2/ default/tabs2/'+(postdata),null,'panel');}, loadComplete: function () { var server_time=jQuery(#%(id)s).getGridParam('userData'); setTimeout(function(){ alert(server_time); jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 1000); /* 1000..after 1 seconds */ }, loadError: function () { setTimeout(function(){ jQuery(#%(id)s).jqGrid().setGridParam({datatype:json}); jQuery(#%(id)s).jqGrid().trigger(reloadGrid, [{current:true}]); }, 15000); /* milliseconds (15seconds) */ }, caption:'%(tablename)s', viewrecords: true, height:%(height)s, loadui:disabled}); jQuery(#%(id)s).jqGrid('navGrid','#%(id)s_pager', {search:true,add:false,edit:false,del:false}); jQuery(#%(id)s).setGridWidth(%(width)s,false);}); % dict(callback=callback,colnames=json(colnames), tablename=table._tablename.capitalize(), colmodel=json(colmodel),id=_id,height=height,width=width) return TAG[''](TABLE(_id=_id), DIV(_id=_id+_pager), SCRIPT(script))
[web2py] Re: help us test new admin on windows....
Is it worth a test on Mac? On Nov 10, 10:48 am, mdipierro mdipie...@cs.depaul.edu wrote: download the windows binary (nightly built) from http://web2py.com/examples/default/download with FF and IE, try admin, try create a new app and edit a file, report any problem.
[web2py] Pagination [Web2py Utils] returns None
Hello I am trying to create some pagination on my comments page everything seems to be working, however when I click the next link it goes to a page that all it says is None Anyone know why this is happening and how to fix it There are entries in the db. Thanks in Advance below is my code *cheers def product_wall(): this_page = request.args(0) product=db(db.product.id == this_page).select(db.product.ALL) for products in product: #comments=db(db.comment.product == this_page).select(db.comment.ALL) comments=db.comment.product == this_page orderby = ~db.comment.id pcache = (cache.ram, 15) stars = StarRatingWidget(single_vote=True) db.comment.rating.widget = stars.widget db.comment.product.default = products.id form = SQLFORM(db.comment) db.comment.product.id = products.id if form.accepts(request.vars,session): response.flash = 'Your Comment has been submitted' paginate = Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response) rows=paginate.get_set(set_links=True) return dict(comments=rows,form=form,products=products) elif form.errors: response.flash = 'Please correct your error' paginate = Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response) rows=paginate.get_set(set_links=True) return dict(comments=rows,form=form,products=products) else: paginate = Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response) rows=paginate.get_set(set_links=True) return dict(comments=rows,form=form,products=products)
[web2py] Re: new demo appliance for gmap and fullcalendar
Nice example... Just a note : Line 25 of mycal.html stop: new Date('{{=row.f_end_time.strftime('%B %d, %Y %H:%M:%S')}}'), should be: end: new Date('{{=row.f_end_time.strftime('%B %d, %Y %H:%M:%S')}}'), So events longer than a day render correctly. On 10 nov, 16:35, mdipierro mdipie...@cs.depaul.edu wrote: http://web2py.com/appliances/default/show/71
[web2py] plugin wiki on older aps?
Hi, Helping my daughter with a school project and she loves the look of web2py in the Example minimalist wiki with versioning and authentication. She 's making a memory game (not sure how, but she is ;) ). Since she knows how to use the widget builder in plugin_wiki, she installed it, has the pages menu item and everything seem to be good. But some of the widgets like comments and action_load just stay seem to be stuck on loading (doesn't resolve to a widget). Assuming something is missing, would anybody know what that is ? I added everything I could think of, but no go yet. Thanks, Mart :)
Re: [web2py] plugin wiki on older aps?
You have to replace web2py_ajax.html to a new version. web2py_components depends on some things in web2py_ajax.html! 2010/11/10 mart msenecal...@gmail.com Hi, Helping my daughter with a school project and she loves the look of web2py in the Example minimalist wiki with versioning and authentication. She 's making a memory game (not sure how, but she is ;) ). Since she knows how to use the widget builder in plugin_wiki, she installed it, has the pages menu item and everything seem to be good. But some of the widgets like comments and action_load just stay seem to be stuck on loading (doesn't resolve to a widget). Assuming something is missing, would anybody know what that is ? I added everything I could think of, but no go yet. Thanks, Mart :) -- http://rochacbruno.com.br
Re: [web2py] plugin wiki on older aps?
The newest version http://code.google.com/p/web2py/source/browse/applications/welcome/views/web2py_ajax.html 2010/11/10 Bruno Rocha rochacbr...@gmail.com You have to replace web2py_ajax.html to a new version. web2py_components depends on some things in web2py_ajax.html! 2010/11/10 mart msenecal...@gmail.com Hi, Helping my daughter with a school project and she loves the look of web2py in the Example minimalist wiki with versioning and authentication. She 's making a memory game (not sure how, but she is ;) ). Since she knows how to use the widget builder in plugin_wiki, she installed it, has the pages menu item and everything seem to be good. But some of the widgets like comments and action_load just stay seem to be stuck on loading (doesn't resolve to a widget). Assuming something is missing, would anybody know what that is ? I added everything I could think of, but no go yet. Thanks, Mart :) -- http://rochacbruno.com.br -- http://rochacbruno.com.br
[web2py] Re: IMG helper and _width
@Bruno, Thanks for providing me with a working solution. @Denes, Thanks for explaining me why I got this error. Kind regards, Annet. On Nov 10, 3:20 pm, DenesL denes1...@yahoo.ca wrote: Annet, allow me a little explanation on why you got SyntaxError: keyword can't be an expression. web2py does not know that you are using CSS inside HTML, the error happens because IMG is expecting named arguments, which are dictionary keys and those keys must be valid hashable ids. _src is a valid hashable id. _vertical-align is not, because python will try to interpret that as the following expression: _vertical (an id) minus (math operator) align (another id). Hope this helps. On Nov 10, 7:00 am, Martín Mulone mulone.mar...@gmail.com wrote: Like bruno said, there are no attribute vertical-align in img object, this is css style thing 2010/11/10 Bruno Rocha rochacbr...@gmail.com This is working for me: {{=IMG(_src=URL(r=request,a='base',c='static',f='base/card/logos/%s' % logo[0].link), _style=vertical-align:'middle';)}} 2010/11/10 annet annet.verm...@gmail.com Massimo, Thanks, problem solved. However, this: {{=IMG(_src=URL(r=request,a='base',c='static',f='base/card/logos/%s' % logo[0].link), _vertical-align=middle)}} .. result in a SyntaxError: keyword can't be an expression According to W3C I should be able to set vertical-align on an img. Kind regards, Annet. -- http://rochacbruno.com.br -- My blog:http://martin.tecnodoc.com.ar My portfolio *spanish*:http://www.tecnodoc.com.ar Checkout my last proyect instant-press:http://www.instant2press.com
[web2py] Re: help us test new admin on windows....
Creating a new app and editing files seems to work fine in IE and FF on Windows. One question: For files in subfolders, there is no slash in between the folder and file name (e.g., under static/css/ it says css base.css instead of css/base.css) -- is that intentional? Actually, now that we're indenting the file names within subfolders, maybe we can simply get rid of the path altogether (this will especially help when there are several nested subfolders). A couple additional issues (these aren't new): - In IE, when you position the cursor within EditArea, about 10-20 characters to the right of the cursor are automatically highlighted in blue. This doesn't seem to hinder the functionality, but it's annoying and confusing. - I'm just noticing some problems with very long load times (e.g. a couple minutes or more) for some applications on occasion (e.g., the welcome app or the examples app). It seems to be a problem when I open multiple apps in separate tabs, particularly if one of the tabs is admin (e.g., admin is open in one tab, then open a test app, then open welcome, then open examples -- in that case, examples will hang for several minutes, even though the other apps are all finished loading -- if I close the other apps, I can open examples instantly). I assume this has something to do with Rocket. Anthony On Nov 10, 10:48 am, mdipierro mdipie...@cs.depaul.edu wrote: download the windows binary (nightly built) from http://web2py.com/examples/default/download with FF and IE, try admin, try create a new app and edit a file, report any problem.
[web2py] Re: plugin wiki on older aps?
ah, i see it! :) Great! I must have declined the replace file? while dropping an updated filesset. thank you very much for that! :) On Nov 10, 12:35 pm, Bruno Rocha rochacbr...@gmail.com wrote: The newest versionhttp://code.google.com/p/web2py/source/browse/applications/welcome/vi... 2010/11/10 Bruno Rocha rochacbr...@gmail.com You have to replace web2py_ajax.html to a new version. web2py_components depends on some things in web2py_ajax.html! 2010/11/10 mart msenecal...@gmail.com Hi, Helping my daughter with a school project and she loves the look of web2py in the Example minimalist wiki with versioning and authentication. She 's making a memory game (not sure how, but she is ;) ). Since she knows how to use the widget builder in plugin_wiki, she installed it, has the pages menu item and everything seem to be good. But some of the widgets like comments and action_load just stay seem to be stuck on loading (doesn't resolve to a widget). Assuming something is missing, would anybody know what that is ? I added everything I could think of, but no go yet. Thanks, Mart :) -- http://rochacbruno.com.br -- http://rochacbruno.com.br
Re: [web2py] Re: help us test new admin on windows....
On Wed, Nov 10, 2010 at 6:51 PM, Anthony abasta...@gmail.com wrote: now that we're indenting the file names within subfolders, maybe we can simply get rid of the path altogether (this will especially help when there are several nested subfolders). I absolutely agree. In fact, I would have done it myself, but that part of the code was a bit fiddly, so I mostly left it alone. I keep forgetting to ask Massimo about this. -- Branko Vukelić bg.bra...@gmail.com stu...@brankovukelic.com Check out my blog: http://www.brankovukelic.com/ Check out my portfolio: http://www.flickr.com/photos/foxbunny/ Registered Linux user #438078 (http://counter.li.org/) I hang out on identi.ca: http://identi.ca/foxbunny Gimp Brushmakers Guild http://bit.ly/gbg-group
[web2py] flow charts
Hey, Anybody know of any relatively decent flow chart app out there that would be compatible with web2py? Thanks, Mart :)
[web2py] Re: plugin wiki on older aps?
Works great! double thanks! she'll be thrilled, now I just need to change the blueish-green header/footer to purple, then I can walk away :) On Nov 10, 12:51 pm, mart msenecal...@gmail.com wrote: ah, i see it! :) Great! I must have declined the replace file? while dropping an updated filesset. thank you very much for that! :) On Nov 10, 12:35 pm, Bruno Rocha rochacbr...@gmail.com wrote: The newest versionhttp://code.google.com/p/web2py/source/browse/applications/welcome/vi... 2010/11/10 Bruno Rocha rochacbr...@gmail.com You have to replace web2py_ajax.html to a new version. web2py_components depends on some things in web2py_ajax.html! 2010/11/10 mart msenecal...@gmail.com Hi, Helping my daughter with a school project and she loves the look of web2py in the Example minimalist wiki with versioning and authentication. She 's making a memory game (not sure how, but she is ;) ). Since she knows how to use the widget builder in plugin_wiki, she installed it, has the pages menu item and everything seem to be good. But some of the widgets like comments and action_load just stay seem to be stuck on loading (doesn't resolve to a widget). Assuming something is missing, would anybody know what that is ? I added everything I could think of, but no go yet. Thanks, Mart :) -- http://rochacbruno.com.br -- http://rochacbruno.com.br
[web2py] problem whith admin
I have to edit some applications problems with the new admin. With some works without problems. In other gives the following error: Traceback (most recent call last): File /usr/home/jose/web2py/gluon/restricted.py, line 188, in restricted exec ccode in environment File /usr/home/jose/web2py/applications/admin/views/default/ design.html, line 290, in module /div IndexError: list index out of range Jose
[web2py] Re: cas incorrect address in email
fixed everywhere I think On Nov 10, 9:58 am, leone handja...@gmail.com wrote: Hi, CAS return this incorrect address in emailhttps://mdp.cti.depaul.edu/cas/cas/verify?id=191key=d1c373ab1570cfb9... It must behttps://www.web2py.com/cas/cas/verify?id=191key=d1c373ab1570cfb9a7db... What can I do to correct it. There is a CAS application downloadable? Thanks leone
[web2py] Re: Pyodbc error with web2py under Apache and mod_wsgi
Hi Massimo, Thanks for your prompt response. That was my first thought as well. The system I'm working on though is a pretty fresh build and searching the file system for 'site-packages' I only find results (as expected) within web2py and in my python installation folder, 'C:\python'. So unless modwsgi (or some other installed software) ships with a copy of python I think it's using the correct version. I see in the Apache error.log file when starting Apache the following message: [Tue Nov 09 18:25:58 2010] [notice] Apache/2.2.17 (Win32) mod_ssl/ 2.2.17 OpenSSL/0.9.8o mod_wsgi/3.3 Python/2.7 configured -- resuming normal operations Python 2.7 is what I installed, but I'm not sure how to have modwsgi verify the path to the specific python interpreter that it's using. I added a few lines of debug in gluon.sql.py: sys.path returns: [Tue Nov 09 18:26:01 2010] [error] ['', 'C:web2pysite- packages', 'C:web2py', 'C:Windowssystem32\\\ \python27.zip', 'C:PythonLib', 'C:PythonDLLs', 'C:\\\ \PythonLiblib-tk', 'C:Program Files (x86)Apache Software FoundationApache2.2', 'C:Program Files (x86)\\\ \Apache Software FoundationApache2.2bin', 'C:Python', 'C:\\ \\Pythonlibsite-packages', '../gluon'] Also, I printed the stack trace after it throws the exception trying to load pyodbc: [Tue Nov 09 18:26:01 2010] [error] Traceback (most recent call last): [Tue Nov 09 18:26:01 2010] [error] File C:\\web2py\\gluon\\sql.py, line 95, in module [Tue Nov 09 18:26:01 2010] [error] import pyodbc [Tue Nov 09 18:26:01 2010] [error] ImportError: DLL load failed: The specified module could not be found. I did find a post regarding DLLs failing to load under mod_wsgi (http://groups.google.com/group/modwsgi/browse_thread/thread/ 013b4a5faa962d77/107d04edc473d732?#107d04edc473d732) where the solution seemed to be using MinGWto compile psycopg2. Since I used the Windows Installer version of pyodbc, I may go back and try to build pyodbc following these steps as well. I'm also wondering if this could be related to either a windows or Apache security issue since pyodbc works with web2py directly (bypassing Apache/mod_wsgi). I'll work on building a fresh pyodbc on my system with MinGW, but if any of this additional info leads to any other suggestions I'm all ears, since I'm largely guessing at this point! :) Thanks, Adam On Nov 9, 10:35 pm, mdipierro mdipie...@cs.depaul.edu wrote: you may have different python versions installed. Check the one used by modwsgi On Nov 9, 3:02 pm, azarkowsky azarkow...@gmail.com wrote: Hi, I'm relatively new to web2py and am attempting to set up my production environment for the first time. I'm running Apache2.2 with mod_wsgi, python 2.7, web2py 1.88.2 on Win XP SP3. If I run web2py without Apache by running: 'python web2py.py -a recycle -i 127.0.0.1 -p 8000' I can access both my application and the admin interface without any problems. Once I try to access my site running behind Apache though, I receive a ticket containing the following trackback: Traceback (most recent call last): File C:\web2py\gluon\restricted.py, line 188, in restricted exec ccode in environment File C:/web2py/applications/lunch/models/db.py, line 11, in module db = DAL('mssql://lunch:lu...@b1ts003/lunch1') File C:\web2py\gluon\sql.py, line 4048, in DAL raise RuntimeError, %s (tried 5 times) % exception RuntimeError: global name 'pyodbc' is not defined (tried 5 times) If I run web2py in terminal mode and import pyodbc I don't receive any errors: C:\web2pypython web2py.py -S welcome -P No handlers could be found for logger web2py web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2010 Version 1.88.2 (2010-10-29 23:04:43) Database drivers available: SQLite3, MSSQL/DB2 Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win 32 Type help, copyright, credits or license for more information. (InteractiveConsole) import pyodbc I'm sure I'm probably just missing something in my confiration, but after scouring the web2py book and searching Google I haven't been able to find a solution. I'd greatly appreciate any suggestions, or if you need additional info, please let me know! Thanks, Adam
[web2py] another component question
Hello web2py users, I've been playing around with components recently and they are helping me modularize my application. I was hoping someone could explain to me why they do what they do. I've noticed that when a controller function that is referenced by a component returns a dict(), it requires a view, but when the function returns a string, it doesn't. Also, when I return a very long string, there is an error with the request, but this does not happen with a dict attribute containing that same string - why is this ? One more thing - is there a way to dynamically create components via javascript? Is it simply just calling a function in the views/ web2py_ajax.html view ? Thanks in advance, Chris
Re: [web2py] Re: plugin wiki on older aps?
You can try web2py.com/layouts Enviado via iPhone Em 10/11/2010, às 16:04, mart msenecal...@gmail.com escreveu: Works great! double thanks! she'll be thrilled, now I just need to change the blueish-green header/footer to purple, then I can walk away :) On Nov 10, 12:51 pm, mart msenecal...@gmail.com wrote: ah, i see it! :) Great! I must have declined the replace file? while dropping an updated filesset. thank you very much for that! :) On Nov 10, 12:35 pm, Bruno Rocha rochacbr...@gmail.com wrote: The newest versionhttp://code.google.com/p/web2py/source/browse/applications/welcome/vi... 2010/11/10 Bruno Rocha rochacbr...@gmail.com You have to replace web2py_ajax.html to a new version. web2py_components depends on some things in web2py_ajax.html! 2010/11/10 mart msenecal...@gmail.com Hi, Helping my daughter with a school project and she loves the look of web2py in the Example minimalist wiki with versioning and authentication. She 's making a memory game (not sure how, but she is ;) ). Since she knows how to use the widget builder in plugin_wiki, she installed it, has the pages menu item and everything seem to be good. But some of the widgets like comments and action_load just stay seem to be stuck on loading (doesn't resolve to a widget). Assuming something is missing, would anybody know what that is ? I added everything I could think of, but no go yet. Thanks, Mart :) -- http://rochacbruno.com.br -- http://rochacbruno.com.br
[web2py] Re: making layout plugin
Hi John, I'm interested on the theme you are working on for web2py, in case you want to share. Thanks!, Carlos On Nov 9, 4:25 am, John Murphy wonsu...@gmail.com wrote: There are numerous web2py themes, but none of them are very good. So I decided to make a nice one based on:http://demo.woothemes.com/?name=meta-morphosis. I'm creating a layout plugin according to these instructions: -http://web2py.com/book/default/chapter/13#Layout-plugins -http://www.web2py.com/AlterEgo/default/show/92 I tried the following from the official book: Third, modify the views/layout.html so that it simply reads: 1. {{include 'plugin_layout_name/layout.html'}} It almost works, however the {{include}} in my layout.html is not expanded. Earlier in the same file, {{include 'web2py_ajax.html'}} expands as expected. If I over-write the views/layout.html file instead of {{including}} it as recommended, it works. Any ideas as to why? Also, what's the easiest way to package this as a web2py plugin? (Like:http://www.web2py.com/layouts/static/plugin_layouts/plugins/web2py.pl... ) I'd be happy to share my work if anyone is interested. I intentionally picked a free, GPL'ed theme. Thanks, John --www.leftium.comhttp://www.leftium.com/?sig_gmail
[web2py] Web2py Application Exhibition ( Version 2.0 ) 5 weeks to go!
Just in case you didn't see the pinned message at the top of the group messages, there are 5 weeks to get your apps ready for the Web2py Application Exhibition ( Version 2.0 ) For more details, see the pinned message. Good Luck! Mr.NetAdmin
[web2py] Re: linked tables and dropdown display
hi is it possible to create a text field in table 'advandced' containing 'name1' (no reference, just characters) andrej On 10 nov., 15:22, mdipierro mdipie...@cs.depaul.edu wrote: ERRATA: do this: db.define.table('basic' Field('name1') ...,format='%(name1)s') db.define.table('advanced' Field('name2',db.basic) ...,format=lambda row: db.basic(row.name2).name1) # db.advanced.name.requires=IS_IN_DB(db,'basic.id','%(name1)s') db.define.table('data' Field('something',db.advanced) ...) but this is going to be SOOO slow. You are making two select per each row in the dropdown. On Nov 4, 8:59 am, mdipierro mdipie...@cs.depaul.edu wrote: do this: db.define.table('basic' Field('name1') ...,format='%(name1)s') db.define.table('advanced' Field('name2',db.basic) ...,format='%(name2)s') # db.advanced.name.requires=IS_IN_DB(db,'basic.id','%(name1)s') db.define.table('data' Field('something',db.advanced) ...)
[web2py] Can I use redirect to pass hash variable?
All, I just realized that when I pass a hash variable to redirect, it will get converted into a string? Is there a way I can pass a hash variable via redirect? for example, redirect(URL(r=request, f='scmView.html',vars=dict(scmResult=scmResult, a= a, totalCm=totalCm,osPath=osPath,scmOUI=scmOUI,scmOUIName=scmOUIName))) scmOUI and scmOUIName are string after the redirect and I verify that by using type operation. cheers, tom
Re: [web2py] Re: making layout plugin
I kind of stopped working on it after I learned that the Web2Py nightly has a default layout that is much more pleasing to the eye. I just wanted to demo my Web2Py appliances with a better looking theme. You can grab what I have, though: http://dl.dropbox.com/u/508947/plugin_layout_metamorphosis.zip It is in a working, usable state. (Suggestions for better ways to package and distribute this plugin appreciated.) TODO: - remove extraneous files (including the default Web2Py files except layout.html) - adjust colors in #top section - cleanup/tweak CSS - include GPL license If I were to do this again, I would start from the new Web2Py default layout. John On Thu, Nov 11, 2010 at 4:13 AM, Carlos carlosgali...@gmail.com wrote: Hi John, I'm interested on the theme you are working on for web2py, in case you want to share. Thanks!, Carlos
[web2py] Re: help us test new admin on windows....
fixed in trunk On Nov 10, 11:55 am, Branko Vukelic bg.bra...@gmail.com wrote: On Wed, Nov 10, 2010 at 6:51 PM, Anthony abasta...@gmail.com wrote: now that we're indenting the file names within subfolders, maybe we can simply get rid of the path altogether (this will especially help when there are several nested subfolders). I absolutely agree. In fact, I would have done it myself, but that part of the code was a bit fiddly, so I mostly left it alone. I keep forgetting to ask Massimo about this. -- Branko Vukelić bg.bra...@gmail.com stu...@brankovukelic.com Check out my blog:http://www.brankovukelic.com/ Check out my portfolio:http://www.flickr.com/photos/foxbunny/ Registered Linux user #438078 (http://counter.li.org/) I hang out on identi.ca:http://identi.ca/foxbunny Gimp Brushmakers Guildhttp://bit.ly/gbg-group
[web2py] Re: another component question
On Nov 10, 12:50 pm, Chris Baron topher.ba...@gmail.com wrote: Hello web2py users, I've been playing around with components recently and they are helping me modularize my application. I was hoping someone could explain to me why they do what they do. I've noticed that when a controller function that is referenced by a component returns a dict(), it requires a view, but when the function returns a string, it doesn't. Can you provide an example. I never noticed this. Also, when I return a very long string, there is an error with the request, but this does not happen with a dict attribute containing that same string - why is this ? One more thing - is there a way to dynamically create components via javascript? Is it simply just calling a function in the views/ web2py_ajax.html view ? Thanks in advance, Chris
[web2py] Re: linked tables and dropdown display
db.define.table('advanced' Field('name1',requires=IS_IN_DB(db,'basic.name1')), On Nov 10, 1:49 pm, andrej burja andrej.bu...@gmail.com wrote: hi is it possible to create a text field in table 'advandced' containing 'name1' (no reference, just characters) andrej On 10 nov., 15:22, mdipierro mdipie...@cs.depaul.edu wrote: ERRATA: do this: db.define.table('basic' Field('name1') ...,format='%(name1)s') db.define.table('advanced' Field('name2',db.basic) ...,format=lambda row: db.basic(row.name2).name1) # db.advanced.name.requires=IS_IN_DB(db,'basic.id','%(name1)s') db.define.table('data' Field('something',db.advanced) ...) but this is going to be SOOO slow. You are making two select per each row in the dropdown. On Nov 4, 8:59 am, mdipierro mdipie...@cs.depaul.edu wrote: do this: db.define.table('basic' Field('name1') ...,format='%(name1)s') db.define.table('advanced' Field('name2',db.basic) ...,format='%(name2)s') # db.advanced.name.requires=IS_IN_DB(db,'basic.id','%(name1)s') db.define.table('data' Field('something',db.advanced) ...)
[web2py] Re: help us test new admin on windows....
I tried the nightly on Win7 with FF 3.6 and IE. I couldn't break anything significant. Creating an app and fiddling around with it worked just fine. One thing that's a bit odd is the in file search, which doesn't seem to have any effect on FF (I entered index and pressed enter). On IE it's a bit different: index and [enter] collapsed all sections (Models, Controllers, Views,...) and they couldn't be expanded again after this. Only F5 solved this. Thank You all for the new design(s). I like them a lot! regards Stephan On 10 Nov., 16:48, mdipierro mdipie...@cs.depaul.edu wrote: download the windows binary (nightly built) from http://web2py.com/examples/default/download with FF and IE, try admin, try create a new app and edit a file, report any problem.
[web2py] Re: Can I use redirect to pass hash variable?
URL generates a URL, it can only contains strings. On Nov 10, 1:50 pm, Tom Chang t72...@gmail.com wrote: All, I just realized that when I pass a hash variable to redirect, it will get converted into a string? Is there a way I can pass a hash variable via redirect? for example, redirect(URL(r=request, f='scmView.html',vars=dict(scmResult=scmResult, a= a, totalCm=totalCm,osPath=osPath,scmOUI=scmOUI,scmOUIName=scmOUIName))) scmOUI and scmOUIName are string after the redirect and I verify that by using type operation. cheers, tom
[web2py] Re: help us test new admin on windows....
IE8 to be precise On 10 Nov., 21:00, qqsaqq sla...@gmx.net wrote: I tried the nightly on Win7 with FF 3.6 and IE. I couldn't break anything significant. Creating an app and fiddling around with it worked just fine. One thing that's a bit odd is the in file search, which doesn't seem to have any effect on FF (I entered index and pressed enter). On IE it's a bit different: index and [enter] collapsed all sections (Models, Controllers, Views,...) and they couldn't be expanded again after this. Only F5 solved this. Thank You all for the new design(s). I like them a lot! regards Stephan On 10 Nov., 16:48, mdipierro mdipie...@cs.depaul.edu wrote: download the windows binary (nightly built) from http://web2py.com/examples/default/download with FF and IE, try admin, try create a new app and edit a file, report any problem.
Re: [web2py] Re: ProgrammingError: (2014, Commands out of sync; you can't run this command now)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This one is also quite common: Traceback (most recent call last): File /opt/web2py/gluon/main.py, line 475, in wsgibase BaseAdapter.close_all_instances(BaseAdapter.rollback) File /opt/web2py/gluon/sql.py, line 810, in close_all_instances action(instance) File /opt/web2py/gluon/sql.py, line 1393, in rollback self._connection.rollback() ProgrammingError: (2014, Commands out of sync; you can't run this command now) Yes, I have many queries also in try..except blocks. But it is really hard to find what exactly is the root of problem because I did not reveal any meaningful shape in the error occurencies. At least not yet. :( D. mdipierro wrote: Has anybody else here had a similar problem? massimo On Nov 9, 11:29 am, David Zejda d...@atlas.cz wrote: Hi :) E.g. now the exception was raised by the web2py internal db initialization routine: 28: db = SQLDB('mysql://myus:myp...@localhost:330h6/mydb', pool_size=10) Traceback (most recent call last): File /opt/web2py/gluon/restricted.py, line 188, in restricted exec ccode in environment File /opt/web2py/applications/myapp/compiled/models_db.py, line 28, in module File /opt/web2py/gluon/sql.py, line 978, in __init__ self._execute('SET FOREIGN_KEY_CHECKS=1;') File /opt/web2py/gluon/sql.py, line 977, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) File /var/lib/python-support/python2.5/MySQLdb/cursors.py, line 166, in execute self.errorhandler(self, exc, value) File /var/lib/python-support/python2.5/MySQLdb/connections.py, line 35, in defaulterrorhandler raise errorclass, errorvalue ProgrammingError: (2014, Commands out of sync; you can't run this command now) I'm thinking about possibility to raise the size of my poll. But in the past with higher poll I think I was receiving more OperationalError: (2006, 'MySQL server has gone away'). Because I am referring to a live server, I would prefer to avoid experiments which could make frequency of db errors even worse :) thanks wishing you a nice day.. David mdipierro wrote: I cannot say without looking at the code. MySQL has lots of undocumented quirks about what you can do and what you cannot do within one transaction. Try add a db.commit() after each insert/unpdate/form.accepts/ crud.update/crud.select IF you do a select after that. Do you have any try:...except in your controllers and db queries inside? On Nov 8, 2:57 am, David Zejda d...@atlas.cz wrote: The MySQL error occurs quite often, several times every day. The app has about 2 page views daily and heavily communicates with db (tens of queries per request, in db I have about 100 tables). Currently I have pool with size for 10 connections. Meaning of the error message is described here: http://dev.mysql.com/doc/refman/4.1/en/commands-out-of-sync.html It seems that with MySQL statements on the same db connection have to be exhausted one-by-one, never in parallel. Two statements returning data to the process must be using separate DBConnections (possibly to the same host/db). Multiple statements on the same connection are supported, but only 1 may be in a state to 'fetch' data. Traces for the errors look like this: File /opt/web2py/gluon/sql.py, line 3378, in count return self.select('count(*)')[0]._extra['count(*)'] File /opt/web2py/gluon/sql.py, line 3237, in select rows = response(query) File /opt/web2py/gluon/sql.py, line 3232, in response db._execute(query) File /opt/web2py/gluon/sql.py, line 977, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) File /var/lib/python-support/python2.5/MySQLdb/cursors.py, line 166, in execute self.errorhandler(self, exc, value) File /var/lib/python-support/python2.5/MySQLdb/connections.py, line 35, in defaulterrorhandler raise errorclass, errorvalue ProgrammingError: (2014, Commands out of sync; you can't run this command now) Or e.g.: Traceback (most recent call last): File /opt/web2py/gluon/main.py, line 475, in wsgibase BaseAdapter.close_all_instances(BaseAdapter.rollback) File /opt/web2py/gluon/sql.py, line 810, in close_all_instances action(instance) File /opt/web2py/gluon/sql.py, line 1393, in rollback self._connection.rollback() ProgrammingError: (2014, Commands out of sync; you can't run this command now) Do you have any tips how to aviod these errors? Thanks! - -- David Zejda, Open-IT cz web development services http://www.o-it.info -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkza+54ACgkQ3oCkkciamVG10ACgmEIip08ls4k3XRzIsQxWAPxX BIcAn27XoF8Ka9kEPMqZWK16dgwvY6kw =/ISp -END PGP SIGNATURE-
[web2py] Re: Error Installing Appliance
Complete user-error. Although I did reinstall with python 2.5.4 from python.org, and then the binary distribution of web2py, the probably was a result of me trying to install instantpress_beta5.zip. I found the proper file: web2py.app.instantpress_beta5.w2p Installation was without issue. Sorry about that. @Anthony: The reason that I am using python 2.5 is because I want web2py to play nicely with App Engine. If I am limiting myself to learning web2py first and foremost, does it matter that I am using python 2.5?
[web2py] Re: error with uploadfield and blob
Not long at all. Many thanks! On Nov 10, 8:51 am, mdipierro mdipie...@cs.depaul.edu wrote: bug. Fixed in trunk. Sorry it took so long. On Nov 8, 10:38 pm, richard.ree richard.h@gmail.com wrote: I want to upload a file and store it in a blob field: db.define_table( data, Field(citation, string, required=True, notnull=True), Field(datafile, upload, uploadfield=data), Field(data, blob), ) But if I insert a record (through SQLFORM or admin) but leave the datafile field empty, i.e., I input a citation but not a file, I get this error: web2py Version 1.88.2 (2010-10-29 23:04:43) Traceback (most recent call last): File /home/rree/web2py/gluon/restricted.py, line 188, in restricted exec ccode in environment File /home/rree/web2py/applications/mytest/controllers/ appadmin.py, line 410, in module File /home/rree/web2py/gluon/globals.py, line 96, in lambda self._caller = lambda f: f() File /home/rree/web2py/applications/mytest/controllers/ appadmin.py, line 125, in insert if form.accepts(request.vars, session): File /home/rree/web2py/gluon/sqlhtml.py, line 1105, in accepts value = fields[fieldname] KeyError: 'data' How to make the upload field optional? Thanks -Rick
[web2py] Re: CRUD select with autosort headers
But this fails when you to show the result of a query. You can only filter by one field from the serverside. It´s good, but not enough. A lot of potential of this jquery plugin is being lost. The editable jqgrid plugin is good, but is not documented and does not work fully. Would be nice to have its funcionalities fully integrated but I don´t have to do such complex job now. On Nov 5, 1:52 am, mdipierro mdipie...@cs.depaul.edu wrote: Good work. You also have the option to do {{=plugin_wiki.widget('jqgrid',table)}} which is sortable, searchable, resizable, can reorder columns, ajaxpagination, etc. On Nov 4, 4:38 pm, baloan balo...@googlemail.com wrote: Final attempt. Much better now. web2py is cool! def history(): headers, key = auto_orderby(db.email_archive, default_order=('desc', 'id')) emails =crud.select(db.email_archive, headers=headers, orderby=key, limitby=(0, 50)) return dict(emails=emails) def auto_orderby(dal_table, default_order=None): ''' Creates headers and key forcrud.select() tables. @param tablename: dal table @param default_order: ('asc'|'desc', column_name) ''' tablename = dal_table._tablename orderby_key = tablename + '_orderby' if default_order is None: default_order = ('asc', 'id') # create header column links headers = dict() for col in dal_table.fields: headers[tablename + '.' + col] = A(col, _href=URL(vars=dict(orderby=col))) # manage sort order if orderby_key not in session: session[orderby_key] = list(default_order) if 'orderby' in request.vars: if session[orderby_key][1] == request.vars.orderby: if session[orderby_key][0] == 'asc': session[orderby_key][0] = 'desc' else: session[orderby_key][0] = 'asc' else: session[orderby_key] = ['asc', request.vars.orderby] # convert to DAL orderby key = db.email_archive[session[orderby_key][1]] if session[orderby_key][0] == 'desc': key = ~key return (headers, key) Any suggestions for improvement? Regards, Andreas On Nov 4, 10:19 pm, baloan balo...@googlemail.com wrote: An updated attempt: def index(): # create header column links headers = dict() for col in db.email_archive.fields: headers['email_archive.' + col] = A(col, _href=URL(vars=dict(orderby=col))) # manage sort order if 'email_archive_orderby' not in session: session.email_archive_orderby = ['desc', 'id'] if 'orderby' in request.vars: if session.email_archive_orderby[1] == request.vars.orderby: if session.email_archive_orderby[0] == 'asc': session.email_archive_orderby[0] = 'desc' else: session.email_archive_orderby[0] = 'asc' else: session.email_archive_orderby = ['asc', request.vars.orderby] # convert to DAL orderby key = db.email_archive[session.email_archive_orderby[1]] if session.email_archive_orderby[0] == 'desc': key = ~key emails =crud.select(db.email_archive, headers=headers, orderby=key) return dict(emails=emails) On Nov 4, 10:06 pm, baloan balo...@googlemail.com wrote: When I say ugly I mean: 1. too much duplication, 2. too much boilerplate code. Just imagine what happens if I apply my solution to more than a few tables. Regards, Andreas On Nov 4, 10:00 pm, baloan balo...@googlemail.com wrote: This is my feeble attempt at the problem - but it does the job: def index(): add_submenu() headers = {'email.id': A('Id', _href=URL(vars=dict(orderby='id'))), 'email.email': A('Email address', _href=URL(vars=dict(orderby='email'))), 'email.active':A('Active', _href=URL(vars=dict(orderby='active'))), 'email.expires':A('Expires', _href=URL(vars=dict(orderby='expires'))), 'email.change_user':A('Changed by', _href=URL(vars=dict(orderby='change_user'))), 'email.change_date':A('Changed on', _href=URL(vars=dict(orderby='change_date'))), } if 'email_orderby' not in session: session.email_orderby = ['asc', 'email'] if 'orderby' in request.vars: if session.email_orderby[1] == request.vars.orderby: if session.email_orderby[0] == 'asc': session.email_orderby[0] = 'desc' else: session.email_orderby[0] = 'asc' else: session.email_orderby = ['asc', request.vars.orderby] key = db.email[session.email_orderby[1]] if session.email_orderby[0] == 'asc': emails =crud.select(db.email, headers=headers,
[web2py] Re: help us test new admin on windows....
One thing that's a bit odd is the in file search, which doesn't seem to have any effect on FF (I entered index and pressed enter). On IE it's a bit different: index and [enter] collapsed all sections (Models, Controllers, Views,...) and they couldn't be expanded again after this. Only F5 solved this. Actually, I don't think running the search collapses the sections. Instead, I think it is supposed to hide everything except the files that match the search. The problem is, it appears to simply hide everything, including the files that match the search (so the files are hidden, not collapsed). F5 (or clicking the Edit button at the top) gets you back to the original page, without the search. Obviously we should fix the search. But once it's fixed, we should also make sure there's some UI indicator when there are no search results -- otherwise, the user is likely to be confused by what appears to be all of the sections collapsing. Anthony
[web2py] Re: Error Installing Appliance
@Anthony: The reason that I am using python 2.5 is because I want web2py to play nicely with App Engine. If I am limiting myself to learning web2py first and foremost, does it matter that I am using python 2.5? If you're creating an app for App Engine, then I suppose sticking with 2.5 makes sense. And 2.5 will certainly be fine if your main focus is learning web2py.
[web2py] Re: ProgrammingError: (2014, Commands out of sync; you can't run this command now)
Here is a the problem. If you put queries in try... except you must follow this pattern: try: ... any db io ... except: db.rollback() If you do not rollback any subsequent attempt to commit or access the db again results in an error. On Nov 10, 2:07 pm, David Zejda d...@atlas.cz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This one is also quite common: Traceback (most recent call last): File /opt/web2py/gluon/main.py, line 475, in wsgibase BaseAdapter.close_all_instances(BaseAdapter.rollback) File /opt/web2py/gluon/sql.py, line 810, in close_all_instances action(instance) File /opt/web2py/gluon/sql.py, line 1393, in rollback self._connection.rollback() ProgrammingError: (2014, Commands out of sync; you can't run this command now) Yes, I have many queries also in try..except blocks. But it is really hard to find what exactly is the root of problem because I did not reveal any meaningful shape in the error occurencies. At least not yet. :( D. mdipierro wrote: Has anybody else here had a similar problem? massimo On Nov 9, 11:29 am, David Zejda d...@atlas.cz wrote: Hi :) E.g. now the exception was raised by the web2py internal db initialization routine: 28: db = SQLDB('mysql://myus:myp...@localhost:330h6/mydb', pool_size=10) Traceback (most recent call last): File /opt/web2py/gluon/restricted.py, line 188, in restricted exec ccode in environment File /opt/web2py/applications/myapp/compiled/models_db.py, line 28, in module File /opt/web2py/gluon/sql.py, line 978, in __init__ self._execute('SET FOREIGN_KEY_CHECKS=1;') File /opt/web2py/gluon/sql.py, line 977, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) File /var/lib/python-support/python2.5/MySQLdb/cursors.py, line 166, in execute self.errorhandler(self, exc, value) File /var/lib/python-support/python2.5/MySQLdb/connections.py, line 35, in defaulterrorhandler raise errorclass, errorvalue ProgrammingError: (2014, Commands out of sync; you can't run this command now) I'm thinking about possibility to raise the size of my poll. But in the past with higher poll I think I was receiving more OperationalError: (2006, 'MySQL server has gone away'). Because I am referring to a live server, I would prefer to avoid experiments which could make frequency of db errors even worse :) thanks wishing you a nice day.. David mdipierro wrote: I cannot say without looking at the code. MySQL has lots of undocumented quirks about what you can do and what you cannot do within one transaction. Try add a db.commit() after each insert/unpdate/form.accepts/ crud.update/crud.select IF you do a select after that. Do you have any try:...except in your controllers and db queries inside? On Nov 8, 2:57 am, David Zejda d...@atlas.cz wrote: The MySQL error occurs quite often, several times every day. The app has about 2 page views daily and heavily communicates with db (tens of queries per request, in db I have about 100 tables). Currently I have pool with size for 10 connections. Meaning of the error message is described here: http://dev.mysql.com/doc/refman/4.1/en/commands-out-of-sync.html It seems that with MySQL statements on the same db connection have to be exhausted one-by-one, never in parallel. Two statements returning data to the process must be using separate DBConnections (possibly to the same host/db). Multiple statements on the same connection are supported, but only 1 may be in a state to 'fetch' data. Traces for the errors look like this: File /opt/web2py/gluon/sql.py, line 3378, in count return self.select('count(*)')[0]._extra['count(*)'] File /opt/web2py/gluon/sql.py, line 3237, in select rows = response(query) File /opt/web2py/gluon/sql.py, line 3232, in response db._execute(query) File /opt/web2py/gluon/sql.py, line 977, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) File /var/lib/python-support/python2.5/MySQLdb/cursors.py, line 166, in execute self.errorhandler(self, exc, value) File /var/lib/python-support/python2.5/MySQLdb/connections.py, line 35, in defaulterrorhandler raise errorclass, errorvalue ProgrammingError: (2014, Commands out of sync; you can't run this command now) Or e.g.: Traceback (most recent call last): File /opt/web2py/gluon/main.py, line 475, in wsgibase BaseAdapter.close_all_instances(BaseAdapter.rollback) File /opt/web2py/gluon/sql.py, line 810, in close_all_instances action(instance) File /opt/web2py/gluon/sql.py, line 1393, in rollback self._connection.rollback() ProgrammingError: (2014, Commands out of sync; you can't run this command now) Do you have any tips how to aviod these errors? Thanks! - -- David Zejda, Open-IT cz web development serviceshttp://www.o-it.info -BEGIN
[web2py] Re: How to switch back to English for the Admin interface?
I'm not sure how to attach files here, but I've created a patch that creates a dropdown with all possible languages on the admin. Anyone wants it? On Nov 10, 2:53 pm, Stefan Scholl stefan.sch...@gmail.com wrote: I know, but I don't want to use one browser for development (English) and one for the rest (German). On 9 Nov., 14:28, mdipierro mdipie...@cs.depaul.edu wrote: wait. You should not need to delete files. The language is set by your browser. On Nov 9, 3:41 am, Stefan Scholl stefan.sch...@gmail.com wrote: Oops, found it 5 minutes later. In case somebody wants to switch back to English, too: Delete (or rename) your language in applications/admin/languages
[web2py] Re: help us test new admin on windows....
In admin/controllers/default.py|search(), can you add a print statement to make sure it is being called and it is returning te correct list of matching files? On Nov 10, 2:49 pm, Anthony abasta...@gmail.com wrote: One thing that's a bit odd is the in file search, which doesn't seem to have any effect on FF (I entered index and pressed enter). On IE it's a bit different: index and [enter] collapsed all sections (Models, Controllers, Views,...) and they couldn't be expanded again after this. Only F5 solved this. Actually, I don't think running the search collapses the sections. Instead, I think it is supposed to hide everything except the files that match the search. The problem is, it appears to simply hide everything, including the files that match the search (so the files are hidden, not collapsed). F5 (or clicking the Edit button at the top) gets you back to the original page, without the search. Obviously we should fix the search. But once it's fixed, we should also make sure there's some UI indicator when there are no search results -- otherwise, the user is likely to be confused by what appears to be all of the sections collapsing. Anthony
[web2py] Re: How to switch back to English for the Admin interface?
send it to me and I will take a look. On Nov 10, 3:04 pm, guruyaya guruy...@gmail.com wrote: I'm not sure how to attach files here, but I've created a patch that creates a dropdown with all possible languages on the admin. Anyone wants it? On Nov 10, 2:53 pm, Stefan Scholl stefan.sch...@gmail.com wrote: I know, but I don't want to use one browser for development (English) and one for the rest (German). On 9 Nov., 14:28, mdipierro mdipie...@cs.depaul.edu wrote: wait. You should not need to delete files. The language is set by your browser. On Nov 9, 3:41 am, Stefan Scholl stefan.sch...@gmail.com wrote: Oops, found it 5 minutes later. In case somebody wants to switch back to English, too: Delete (or rename) your language in applications/admin/languages
[web2py] Re: Error Installing Appliance
On Nov 10, 3:18 pm, Syed syed.f.ka...@gmail.com wrote: Complete user-error. Although I did reinstall with python 2.5.4 from python.org, and then the binary distribution of web2py Note, if you run the binary version of web2py, I think it simply runs the Python interpreter that comes with web2py (which happens to be 2.5.4), regardless of the Python interpreter you've got installed. If you want it to run from your own installation of Python (and be able to access modules in your Python site-packages), I think you would have to run from source (alternatively, you can put third party modules in the web2py site-packages folder, as discussed here: http://web2py.com/book/default/chapter/04#Third-Party-Modules). Anthony
[web2py] Re: Error Installing Appliance
Nice. Thanks for the tip. If I'm completely new to python and web2py-- and am most interested building web2py apps on GAE--should I just stick to official book for awhile? Will I need to delve into peculiarities of GAE anytime soon?
[web2py] Re: CRON doesn't work
Hi Sverre, I have the exact same issue. (Running web2py 1.87.3) Did you manage to get to work? / jonas On Nov 4, 11:10 am, Sverre sverreodeg...@gmail.com wrote: My cron tab looking like this #crontab */2 * * * * root *sys/test_cron @hourly root *applications/mm/cron/expire_sessions.py but this doesn' work. My test cron function is from time import ctime def test_cron(): db.dbg.insert(dbgmsg=ctime()) db.commit() return ready If I trigger this function manually it's working. Web2Py is installed as a Windows Service. Is someone able to help?
[web2py] Re: CRON doesn't work
Please try the web2py nighlty built. On Nov 10, 3:48 pm, Jonas Rundberg jo...@rundberg.com wrote: Hi Sverre, I have the exact same issue. (Running web2py 1.87.3) Did you manage to get to work? / jonas On Nov 4, 11:10 am, Sverre sverreodeg...@gmail.com wrote: My cron tab looking like this #crontab */2 * * * * root *sys/test_cron @hourly root *applications/mm/cron/expire_sessions.py but this doesn' work. My test cron function is from time import ctime def test_cron(): db.dbg.insert(dbgmsg=ctime()) db.commit() return ready If I trigger this function manually it's working. Web2Py is installed as a Windows Service. Is someone able to help?
[web2py] simple table div
I decided to start to make my own implementation of table maker. The diference with sqltable or TABLE(), it use div (more flexible), accept web2py helpers as values and is very simple to use. Example: http://web2pytesting.appspot.com/tablediv/ Code: table = SIMPLE_TABLE_DIV(fixedwidth=True,maxwidth=500,name=simplet1,number_list=True) table.add_header([{'caption':'Header 1', 'width': 200}, {'caption':'Header 2', 'width': 100}, {'caption':'Header 3', 'width': 100}, ]) table.add_row(['Value 1','Value 2', 'Value 3']) table.add_row(['Value 4','Value 5', 'Value 6']) table.add_row(['Value 7','Value 8', 'Value 9']) If anyone is interested in this or want to contribute, i will put in bitbucket.
[web2py] Re: help us test new admin on windows....
OK, I think I understand and it is fixed. Can you try it again (from trunk)? On Nov 10, 3:43 pm, Anthony abasta...@gmail.com wrote: According to Firebug, when I search for gae, it is calling: http://127.0.0.1:8000/admin/default/search/welcome?keywords=gae and returning the following JSON response: {files: [models\\db.py]} So, it appears to be working -- but the admin design page is not then displaying the output properly. Probably a problem with the javascript/ jQuery code in the view. Anthony On Nov 10, 4:09 pm, mdipierro mdipie...@cs.depaul.edu wrote: In admin/controllers/default.py|search(), can you add a print statement to make sure it is being called and it is returning te correct list of matching files? On Nov 10, 2:49 pm, Anthony abasta...@gmail.com wrote: One thing that's a bit odd is the in file search, which doesn't seem to have any effect on FF (I entered index and pressed enter). On IE it's a bit different: index and [enter] collapsed all sections (Models, Controllers, Views,...) and they couldn't be expanded again after this. Only F5 solved this. Actually, I don't think running the search collapses the sections. Instead, I think it is supposed to hide everything except the files that match the search. The problem is, it appears to simply hide everything, including the files that match the search (so the files are hidden, not collapsed). F5 (or clicking the Edit button at the top) gets you back to the original page, without the search. Obviously we should fix the search. But once it's fixed, we should also make sure there's some UI indicator when there are no search results -- otherwise, the user is likely to be confused by what appears to be all of the sections collapsing. Anthony- Hide quoted text - - Show quoted text -
Re: [web2py] flow charts
Hi mart, Not a flowchart app, a library, but you can make very nice charts if you need to show them with web2py: http://morrisonpitt.com/jsPlumb/html/jquery/demo.html mic 2010/11/10 mart msenecal...@gmail.com: Hey, Anybody know of any relatively decent flow chart app out there that would be compatible with web2py? Thanks, Mart :)
[web2py] Re: Pyodbc error with web2py under Apache and mod_wsgi
I just wanted to add that my new build of pyodbc using MinGW32 didn't seem to work either. I removed pyodbc from my Python site-packages folder and after installing MingW and adding it to my PATH in the pyodbc source folder I ran 'python setup.py build -c mingw32' followed by 'python setup.py install'. This seemed to yield the same result: I can import pyodbc fine as long as I'm not running through mod_wsgi. Dependency Walker states it is having trouble resolving several libraries (MSVCR90.DLL, GPSVC.DLL, IESHIMS.DLL LINKINFO.DLL) when I open c:\python\lib\site-packages\PYODBC.PYD although I saw reference to Dependency Walker erroneously reporting missing DLLs due to something related to SideBySide Assembly. Since DLLs and pretty far out of my realm of expertise and web2py works quite well without mod_wsgi I may take another look at mod_proxy. Is it OK to use the built-in Rocket web server in a production environment? The only reference I saw to this in the web2py book was that it's just not terribly configurable. Would there be any other reasons against it? Thanks, Adam On Nov 10, 1:37 pm, azarkowsky azarkow...@gmail.com wrote: Hi Massimo, Thanks for your prompt response. That was my first thought as well. The system I'm working on though is a pretty fresh build and searching the file system for 'site-packages' I only find results (as expected) within web2py and in my python installation folder, 'C:\python'. So unless modwsgi (or some other installed software) ships with a copy of python I think it's using the correct version. I see in the Apache error.log file when starting Apache the following message: [Tue Nov 09 18:25:58 2010] [notice] Apache/2.2.17 (Win32) mod_ssl/ 2.2.17 OpenSSL/0.9.8o mod_wsgi/3.3 Python/2.7 configured -- resuming normal operations Python 2.7 is what I installed, but I'm not sure how to have modwsgi verify the path to the specific python interpreter that it's using. I added a few lines of debug in gluon.sql.py: sys.path returns: [Tue Nov 09 18:26:01 2010] [error] ['', 'C:web2pysite- packages', 'C:web2py', 'C:Windowssystem32\\\ \python27.zip', 'C:PythonLib', 'C:PythonDLLs', 'C:\\\ \PythonLiblib-tk', 'C:Program Files (x86)Apache Software FoundationApache2.2', 'C:Program Files (x86)\\\ \Apache Software FoundationApache2.2bin', 'C:Python', 'C:\\ \\Pythonlibsite-packages', '../gluon'] Also, I printed the stack trace after it throws the exception trying to load pyodbc: [Tue Nov 09 18:26:01 2010] [error] Traceback (most recent call last): [Tue Nov 09 18:26:01 2010] [error] File C:\\web2py\\gluon\\sql.py, line 95, in module [Tue Nov 09 18:26:01 2010] [error] import pyodbc [Tue Nov 09 18:26:01 2010] [error] ImportError: DLL load failed: The specified module could not be found. I did find a post regarding DLLs failing to load under mod_wsgi (http://groups.google.com/group/modwsgi/browse_thread/thread/ 013b4a5faa962d77/107d04edc473d732?#107d04edc473d732) where the solution seemed to be using MinGWto compile psycopg2. Since I used the Windows Installer version of pyodbc, I may go back and try to build pyodbc following these steps as well. I'm also wondering if this could be related to either a windows or Apache security issue since pyodbc works with web2py directly (bypassing Apache/mod_wsgi). I'll work on building a fresh pyodbc on my system with MinGW, but if any of this additional info leads to any other suggestions I'm all ears, since I'm largely guessing at this point! :) Thanks, Adam On Nov 9, 10:35 pm, mdipierro mdipie...@cs.depaul.edu wrote: you may have different python versions installed. Check the one used by modwsgi On Nov 9, 3:02 pm, azarkowsky azarkow...@gmail.com wrote: Hi, I'm relatively new to web2py and am attempting to set up my production environment for the first time. I'm running Apache2.2 with mod_wsgi, python 2.7, web2py 1.88.2 on Win XP SP3. If I run web2py without Apache by running: 'python web2py.py -a recycle -i 127.0.0.1 -p 8000' I can access both my application and the admin interface without any problems. Once I try to access my site running behind Apache though, I receive a ticket containing the following trackback: Traceback (most recent call last): File C:\web2py\gluon\restricted.py, line 188, in restricted exec ccode in environment File C:/web2py/applications/lunch/models/db.py, line 11, in module db = DAL('mssql://lunch:lu...@b1ts003/lunch1') File C:\web2py\gluon\sql.py, line 4048, in DAL raise RuntimeError, %s (tried 5 times) % exception RuntimeError: global name 'pyodbc' is not defined (tried 5 times) If I run web2py in terminal mode and import pyodbc I don't receive any errors: C:\web2pypython web2py.py -S welcome -P No handlers could be found for logger web2py web2py Enterprise Web Framework
Re: [web2py] simple table div
Nice! I want to use it. I am thinking in a way to create a inline editable table. Enviado via iPhone Em 10/11/2010, às 20:08, Martin.Mulone mulone.mar...@gmail.com escreveu: I decided to start to make my own implementation of table maker. The diference with sqltable or TABLE(), it use div (more flexible), accept web2py helpers as values and is very simple to use. Example: http://web2pytesting.appspot.com/tablediv/ Code: table = SIMPLE_TABLE_DIV(fixedwidth=True,maxwidth=500,name=simplet1,number_list=True) table.add_header([{'caption':'Header 1', 'width': 200}, {'caption':'Header 2', 'width': 100}, {'caption':'Header 3', 'width': 100}, ]) table.add_row(['Value 1','Value 2', 'Value 3']) table.add_row(['Value 4','Value 5', 'Value 6']) table.add_row(['Value 7','Value 8', 'Value 9']) If anyone is interested in this or want to contribute, i will put in bitbucket.
[web2py] Re: Pagination [Web2py Utils] returns None
I just noticed the difference in URLs https://127.0.0.1:8000/Working/display/product_wall/4056 above is the comments on the product notice the id. below is the next link of the pagination https://www.127.0.0.1:8000/Working/display/product_wall?p=5 it loses the 4056 which is the id of the product I think it may have to do with response value. Any ideas? On Wed, Nov 10, 2010 at 9:04 AM, Andrew Evans randra...@gmail.com wrote: Hello I am trying to create some pagination on my comments page everything seems to be working, however when I click the next link it goes to a page that all it says is None Anyone know why this is happening and how to fix it There are entries in the db. Thanks in Advance below is my code *cheers def product_wall(): this_page = request.args(0) product=db(db.product.id == this_page).select(db.product.ALL) for products in product: #comments=db(db.comment.product == this_page).select(db.comment.ALL) comments=db.comment.product == this_page orderby = ~db.comment.id pcache = (cache.ram, 15) stars = StarRatingWidget(single_vote=True) db.comment.rating.widget = stars.widget db.comment.product.default = products.id form = SQLFORM(db.comment) db.comment.product.id = products.id if form.accepts(request.vars,session): response.flash = 'Your Comment has been submitted' paginate = Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response) rows=paginate.get_set(set_links=True) return dict(comments=rows,form=form,products=products) elif form.errors: response.flash = 'Please correct your error' paginate = Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response) rows=paginate.get_set(set_links=True) return dict(comments=rows,form=form,products=products) else: paginate = Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response) rows=paginate.get_set(set_links=True) return dict(comments=rows,form=form,products=products)
[web2py] Re: flow charts
Mic, now that's what I'm talking about! That looks awesome! :) Thanks for that! Mart :) On Nov 10, 5:33 pm, Michele Comitini michele.comit...@gmail.com wrote: Hi mart, Not a flowchart app, a library, but you can make very nice charts if you need to show them with web2py: http://morrisonpitt.com/jsPlumb/html/jquery/demo.html mic 2010/11/10 mart msenecal...@gmail.com: Hey, Anybody know of any relatively decent flow chart app out there that would be compatible with web2py? Thanks, Mart :)
[web2py] Re: medical data
have you checked this page? http://en.wikipedia.org/wiki/List_of_open_source_healthcare_software Mart :) On Nov 10, 5:44 pm, mdipierro mdipie...@cs.depaul.edu wrote: Does anybody know of a free database (xml or csv) of medical conditions and/or drugs?
[web2py] Re: plugin wiki on older aps?
layout , eh? ill give it a go. I assume will be easier then better then me trying the photoshop thing... thanks again Mart :) On Nov 10, 2:10 pm, rochacbruno rochacbr...@gmail.com wrote: You can try web2py.com/layouts Enviado via iPhone Em 10/11/2010, às 16:04, mart msenecal...@gmail.com escreveu: Works great! double thanks! she'll be thrilled, now I just need to change the blueish-green header/footer to purple, then I can walk away :) On Nov 10, 12:51 pm, mart msenecal...@gmail.com wrote: ah, i see it! :) Great! I must have declined the replace file? while dropping an updated filesset. thank you very much for that! :) On Nov 10, 12:35 pm, Bruno Rocha rochacbr...@gmail.com wrote: The newest versionhttp://code.google.com/p/web2py/source/browse/applications/welcome/vi... 2010/11/10 Bruno Rocha rochacbr...@gmail.com You have to replace web2py_ajax.html to a new version. web2py_components depends on some things in web2py_ajax.html! 2010/11/10 mart msenecal...@gmail.com Hi, Helping my daughter with a school project and she loves the look of web2py in the Example minimalist wiki with versioning and authentication. She 's making a memory game (not sure how, but she is ;) ). Since she knows how to use the widget builder in plugin_wiki, she installed it, has the pages menu item and everything seem to be good. But some of the widgets like comments and action_load just stay seem to be stuck on loading (doesn't resolve to a widget). Assuming something is missing, would anybody know what that is ? I added everything I could think of, but no go yet. Thanks, Mart :) -- http://rochacbruno.com.br -- http://rochacbruno.com.br
[web2py] Re: Selecting from dropdown using Ajax
Alex, Thanks for all your help. Yes, you were correct that the issue was simply that the id value was not being passed in the ajax call. Here is my final code for reference if anyone is interested. default.py def test(): firms = db(db.firm).select() return dict(firms=firms) def test_chg(): firm=request.vars.hdnSel strats = db(db.firmstrat.firm_id==firm).select() options=[] for strat in strats: options.append(strat.strat_id.name) return DIV(*options).xml() test.html {{extend 'layout.html'}} input type=hidden id=hdnSel name=hdnSel value= {{=SELECT( _id='firmdrop', _onChange=$('#hdnSel').val(this.value); ajax('test_chg',['hdnSel'],'target');, *[OPTION(firms[i].name,_value=str(firms[i].id)) for i in range(len(firms))] )}} div id=target/div On Nov 9, 9:27 pm, Alex yue.a...@gmail.com wrote: You are definitely correct. I mis-read what you had, but what I put up, you can still use as well if you need to pass args via the URL. In any case, if I am understanding this correctly, it seems to be more of a problem of getting the selected value of the option, correct? There are probably several ways to do this (I actually think jQuery may provide an easy way to get at the selected option). Off the top of my head, this is probably what I would do: - Create a hidden input variable in the form to hold the selected value - before the ajax call, populate the hidden input field with what selected option's value Something like this would need to be added to your code: In the View: - Add this onto your form: input type=hidden id=hdnSel name=hdnSel value= - Add this to the onChange event: _onChange=$ ('#hdnSel').val(this.value); ajax('test_chg',['hdnSel'],'target');, What this does is on the onChange event, it will populate the hidden input we added with the selected option's value. This is then passed through the AJAX call. Hopefully this helps. Let me know :) On Nov 9, 8:28 pm, oneroler samuel.ha...@gmail.com wrote: Alex, Thanks. I thought based on the book that the 2nd argument of ajax was passing the values to request.vars.variable. I pasted some of the code from the book below for reference (http://web2py.com/book/default/ chapter/10?search=ajax#The-ajax-Function). Based on this I originally had the code below in test_chg. Am I mistaken about what the 2nd argument is? Also, regarding your suggestion, could you tell me how to identify the selected item so that I can pass as an args/vars in the URL as you recommended? def one(): return dict() def echo(): return request.vars.name {{extend 'layout.html'}} form input id=name onkeyup=ajax('echo', ['name'], 'target') / /form div id=target/div def test_chg firm=request.vars.firmdrop strats = db(db.firmstrat.firm_id==firm).select() options=[] for strat in strats: options.append(strat.strat_id.name) return DIV(*options).xml() On Nov 8, 9:37 pm, Alex yue.a...@gmail.com wrote: How are you passing the value in the request.vars? I'm going to guess that on your AJAX call in the _onChange handler, you want to specify the parameters. You can do something like: - ajax( '{{=URL(c='controllerName',f='test_chg', args=request.args(0))}}', ['firmdrop'],'target' ) You can pass whatever you want in args. If you have values in request.vars, you should be able to access then like: - request.vars.variableName On Nov 7, 9:11 pm, oneroler samuel.ha...@gmail.com wrote: I'm trying to learn to use the ajax functionality and am having trouble getting it to work correctly. I am trying to use a dropdown of firms to show the related strategies. Currently this doesn't return anything to the div, but I do know that the onchange is working. It seems like the request.vars.values()[0] is not returning anything. Any help would be appreciated and also any pointers if there is a way to do this better differently. Below is my code. I have based this on this messagehttp://groups.google.com/group/web2py/browse_thread/thread/4a6149ddcb default.py def test(): firms = db(db.firm).select() return dict(firms=firms) def test_chg(): firm=request.vars.values()[0] strats = db(db.firmstrat.firm_id==firm).select() options=[] for strat in strats: options.append(strat.strat_id.name) return DIV(*options).xml() test.html {{extend 'layout.html'}} {{=SELECT(_id='firmdrop', _onChange=ajax('test_chg',['firmdrop'],'target');, *[OPTION(firms[i].name,_value=str(firms[i].id)) for i in range(len(firms))] )}} div id=target/div Thanks, Sam- Hide quoted text - - Show quoted text -
[web2py] radio button issue
can anyone figure out something going wrong here? i'm trying to get radio buttons that return True/False but show Yes/No to the user. these buttons look good but no matter what you select, they return True. this happens in appadmin, so there's nothing strange in my view code. Field('isComplete', 'boolean', default=None, widget=SQLFORM.widgets.radio.widget, requires=IS_NULL_OR(IS_IN_SET([True, False], ['Yes', 'No']))), any thoughts? thanks, matt
[web2py] Re: medical data
Not quite what I am looking for. Not software but lists of conditions and drugs. On Nov 10, 6:23 pm, mart msenecal...@gmail.com wrote: have you checked this page? http://en.wikipedia.org/wiki/List_of_open_source_healthcare_software Mart :) On Nov 10, 5:44 pm, mdipierro mdipie...@cs.depaul.edu wrote: Does anybody know of a free database (xml or csv) of medical conditions and/or drugs?
[web2py] Help with No such file or directory error
Hi, i'm trying to make a copy of an image inside my uploads folder. I ´m using the shutil module: import shutil shutil.copy(path, destination) But i get No such file or directory error. Can anyone tell me the correct path if my project is inside: /home/user/web2py/applications/ myproject/uploads/File.file.asdad89018239.128320.jpg Thanks!
Re: [web2py] Re: Pagination [Web2py Utils] returns None
Its losing the args when it creates a new URL. It will require a patch on set_links so you can pass custom args and vars to URL. -- Thadeus On Wed, Nov 10, 2010 at 4:36 PM, Andrew Evans randra...@gmail.com wrote: I just noticed the difference in URLs https://127.0.0.1:8000/Working/display/product_wall/4056 above is the comments on the product notice the id. below is the next link of the pagination https://www.127.0.0.1:8000/Working/display/product_wall?p=5 it loses the 4056 which is the id of the product I think it may have to do with response value. Any ideas? On Wed, Nov 10, 2010 at 9:04 AM, Andrew Evans randra...@gmail.com wrote: Hello I am trying to create some pagination on my comments page everything seems to be working, however when I click the next link it goes to a page that all it says is None Anyone know why this is happening and how to fix it There are entries in the db. Thanks in Advance below is my code *cheers def product_wall(): this_page = request.args(0) product=db(db.product.id == this_page).select(db.product.ALL) for products in product: #comments=db(db.comment.product == this_page).select(db.comment.ALL) comments=db.comment.product == this_page orderby = ~db.comment.id pcache = (cache.ram, 15) stars = StarRatingWidget(single_vote=True) db.comment.rating.widget = stars.widget db.comment.product.default = products.id form = SQLFORM(db.comment) db.comment.product.id = products.id if form.accepts(request.vars,session): response.flash = 'Your Comment has been submitted' paginate = Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response) rows=paginate.get_set(set_links=True) return dict(comments=rows,form=form,products=products) elif form.errors: response.flash = 'Please correct your error' paginate = Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response) rows=paginate.get_set(set_links=True) return dict(comments=rows,form=form,products=products) else: paginate = Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response) rows=paginate.get_set(set_links=True) return dict(comments=rows,form=form,products=products)
[web2py] Re: help us test new admin on windows....
Now I get a flash that says Searching: 1 files -- but it still doesn't display the matching file. On Nov 10, 5:26 pm, mdipierro mdipie...@cs.depaul.edu wrote: OK, I think I understand and it is fixed. Can you try it again (from trunk)? On Nov 10, 3:43 pm, Anthony abasta...@gmail.com wrote: According to Firebug, when I search for gae, it is calling: http://127.0.0.1:8000/admin/default/search/welcome?keywords=gae and returning the following JSON response: {files: [models\\db.py]} So, it appears to be working -- but the admin design page is not then displaying the output properly. Probably a problem with the javascript/ jQuery code in the view. Anthony On Nov 10, 4:09 pm, mdipierro mdipie...@cs.depaul.edu wrote: In admin/controllers/default.py|search(), can you add a print statement to make sure it is being called and it is returning te correct list of matching files? On Nov 10, 2:49 pm, Anthony abasta...@gmail.com wrote: One thing that's a bit odd is the in file search, which doesn't seem to have any effect on FF (I entered index and pressed enter). On IE it's a bit different: index and [enter] collapsed all sections (Models, Controllers, Views,...) and they couldn't be expanded again after this. Only F5 solved this. Actually, I don't think running the search collapses the sections. Instead, I think it is supposed to hide everything except the files that match the search. The problem is, it appears to simply hide everything, including the files that match the search (so the files are hidden, not collapsed). F5 (or clicking the Edit button at the top) gets you back to the original page, without the search. Obviously we should fix the search. But once it's fixed, we should also make sure there's some UI indicator when there are no search results -- otherwise, the user is likely to be confused by what appears to be all of the sections collapsing. Anthony- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[web2py] Re: Error Installing Appliance
On Nov 10, 4:26 pm, Syed syed.f.ka...@gmail.com wrote: Nice. Thanks for the tip. If I'm completely new to python and web2py-- and am most interested building web2py apps on GAE--should I just stick to official book for awhile? Will I need to delve into peculiarities of GAE anytime soon? I haven't done anything with GAE, but I think you'll find the book will serve you well. web2py can handle GAE pretty easily, though I think there are a few special considerations when designing your app. There are references to GAE throughout the book, and a whole section in Chapter 11: http://web2py.com/book/default/chapter/11#Google-App-Engine Anthony
[web2py] Re: help us test new admin on windows....
Can you email the page source in html? On Nov 10, 7:28 pm, Anthony abasta...@gmail.com wrote: Now I get a flash that says Searching: 1 files -- but it still doesn't display the matching file. On Nov 10, 5:26 pm, mdipierro mdipie...@cs.depaul.edu wrote: OK, I think I understand and it is fixed. Can you try it again (from trunk)? On Nov 10, 3:43 pm, Anthony abasta...@gmail.com wrote: According to Firebug, when I search for gae, it is calling: http://127.0.0.1:8000/admin/default/search/welcome?keywords=gae and returning the following JSON response: {files: [models\\db.py]} So, it appears to be working -- but the admin design page is not then displaying the output properly. Probably a problem with the javascript/ jQuery code in the view. Anthony On Nov 10, 4:09 pm, mdipierro mdipie...@cs.depaul.edu wrote: In admin/controllers/default.py|search(), can you add a print statement to make sure it is being called and it is returning te correct list of matching files? On Nov 10, 2:49 pm, Anthony abasta...@gmail.com wrote: One thing that's a bit odd is the in file search, which doesn't seem to have any effect on FF (I entered index and pressed enter). On IE it's a bit different: index and [enter] collapsed all sections (Models, Controllers, Views,...) and they couldn't be expanded again after this. Only F5 solved this. Actually, I don't think running the search collapses the sections. Instead, I think it is supposed to hide everything except the files that match the search. The problem is, it appears to simply hide everything, including the files that match the search (so the files are hidden, not collapsed). F5 (or clicking the Edit button at the top) gets you back to the original page, without the search. Obviously we should fix the search. But once it's fixed, we should also make sure there's some UI indicator when there are no search results -- otherwise, the user is likely to be confused by what appears to be all of the sections collapsing. Anthony- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text -
[web2py] Re: medical data
Try http://www.health.gov.on.ca/english/providers/program/drugs/edition_40.html On Nov 10, 8:02 pm, mdipierro mdipie...@cs.depaul.edu wrote: Not quite what I am looking for. Not software but lists of conditions and drugs. On Nov 10, 6:23 pm, mart msenecal...@gmail.com wrote: have you checked this page? http://en.wikipedia.org/wiki/List_of_open_source_healthcare_software Mart :) On Nov 10, 5:44 pm, mdipierro mdipie...@cs.depaul.edu wrote: Does anybody know of a free database (xml or csv) of medical conditions and/or drugs?
[web2py] Re: flow charts
Hey Mart, If you like visual appealing JavaScript Framework you may also be interested in Raphaël—JavaScript Library What is it? Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want to create your own specific chart or image crop and rotate widget, for example, you can achieve it simply and easily with this library. Raphaël ['ræfeɪəl] uses the SVG W3C Recommendation and VML as a base for creating graphics. This means every graphical object you create is also a DOM object, so you can attach JavaScript event handlers or modify them later. Raphaël’s goal is to provide an adapter that will make drawing vector art compatible cross-browser and easy. Raphaël currently supports Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ and Internet Explorer 6.0+. http://raphaeljs.com/ On Nov 10, 10:14 pm, mart msenecal...@gmail.com wrote: Mic, now that's what I'm talking about! That looks awesome! :) Thanks for that! Mart :) On Nov 10, 5:33 pm, Michele Comitini michele.comit...@gmail.com wrote: Hi mart, Not a flowchart app, a library, but you can make very nice charts if you need to show them with web2py: http://morrisonpitt.com/jsPlumb/html/jquery/demo.html mic 2010/11/10 mart msenecal...@gmail.com: Hey, Anybody know of any relatively decent flow chart app out there that would be compatible with web2py? Thanks, Mart :)
[web2py] Custom JSON-RPC error codes
Hi there, (This is probably more or a small request that a question.) The JSON-RPC service by default always returns error codes of 100. Can we possibly have this amended so that we could say raise a custom JsonRpcException (from within our methods) provide a code, and message and have that code and message returned instead? Thoughts? Matt
[web2py] Re: Learning Management System survey
Interesting thread glad I found it by searching the group because this is what I am doing currently. However, the LMS is designed to be a prototype trial though. I will be testing the beta LMS with a bunch of students next week. I will be interested to help too in this project. On Nov 8, 2:45 pm, mdipierro mdipie...@cs.depaul.edu wrote: At my school we have two systems: 1) peoplesoft (PS) which we use to manage accounting and class enrollments 2) the learning management system (LMS) The LMS gets enrollments from PS. This is because enrollments must be tied to accounting. There are rules on how students are billed, drop dates with full refunds, drop dates with partial refund, etc. Cloudcourse seems to do well that part that we now handle with PS but it is not an LMS and it not integrated with any accounting software. Enrollments must also have full revision history and I do not think cloudcourse does that. If a student changes its status, it must be possible to see what was its status at any moment in time. Massimo On Nov 8, 12:18 am, noel telln...@gmail.com wrote: what do you think about google cloudcourse? On Nov 5, 9:09 pm, Tom Atkins minkto...@gmail.com wrote: I can volunteer time and input for the LMS idea. I'm not experienced enough with Python and web2py yet to contribute good code but can help with frontend UI, design, jQuery and documentation. Assuming the project would have a Free license? I'd be happy to register, host, set up and manage a dedicated site for the project. The site could reference a bitbucket Hg repository (issue tracking there), have a demo, download links (including plugins and themes), a forum for users and developers (I'd be happy to moderate), documentation etc. In daydreaming time I have spent many hours trying to come up with a name for such a system. Because there is already 'desire2learn' in the market it's probably not good to use the '2' in the middle again like web2py. I am fully behind Massimo's focus on the user. As such the universally accepted term 'Learning Management System' (seehttp://en.wikipedia.org/wiki/Learning_management_system) is very appropriate - so how about calling it 'elemes'? get it?! 'elemes.com' and 'elemes.org' are available. I'd be happy to buy these and provide hosting for a site for the project if people think this might be a good name? (You could change it later - but it'd get us started with a place to discuss requirements, design criteria and goals away from the web2py list.) Thoughts? On 3 November 2010 22:35, mdipierro mdipie...@cs.depaul.edu wrote: We need to assemble a team.
[web2py] Re: web2py as a cross-platform mobile application platform
Can you please run these tests for me? cd into the gluon folder and run python from there (or vice versa). From the python shell run from contenttype import contenttype from storage import Storage, StorageList, Settings, Messages from validators import * from html import * from sqlhtml import * from http import * from utils import web2py_uuid import base64 import cPickle import datetime import thread import logging import sys import os import re import time import smtplib import urllib import urllib2 import Cookie from email import * import serializers import contrib.simplejson as simplejson from sql import Field logger = logging.getLogger(web2py) When do you get the MemoryError? On Nov 8, 9:46 pm, mindsynch jb...@fielddiagnostics.com wrote: I just tried to import Mail, Auth, Crud, and Service separately, but each time they gave a MemoryError exception. hmmm interesting! On Nov 8, 9:08 pm, mdipierro mdipie...@cs.depaul.edu wrote: admin should no longer import MARKDOWN but MARKMIN and this will fix that problem. Can you try from gluon.tools import Mail, Auth,Crud, Service, separately and see what it fails? Massimo On Nov 8, 7:14 pm, mindsynch jb...@fielddiagnostics.com wrote: I got this basically working with the following setup: web2py source, Version 1.88.2 PythonCE-2.5-20061219-source.zip fromhttp://sourceforge.net/projects/pythonce/files/ WindowsMobile 5 web2py starts up ok (logger complains about not finding a handle for web2py) I can get a sqllite 3 database running, define tables, insert and select, html is rendered, etc. There are 2 places where I'm getting a MemoryError exception. The first is when running 'from gluon.tools import *' in db.py. The second is when an error ticket is generated: clicking on it generates another error ticket in the admin package when it tries to run 'from markdown2 import *' in the file '\\web2py_src\\gluon\\contrib \\markdown\\__init__.py'
[web2py] Re: Custom JSON-RPC error codes
Ok. In trunk. Please give this a try raise service.JsonRpcException(100,info) On Nov 10, 10:07 pm, Matt mjwat...@gmail.com wrote: Hi there, (This is probably more or a small request that a question.) The JSON-RPC service by default always returns error codes of 100. Can we possibly have this amended so that we could say raise a custom JsonRpcException (from within our methods) provide a code, and message and have that code and message returned instead? Thoughts? Matt
[web2py] blocking problem
I have this problem that I think is related to threading and web2py. I have an apache2 standard setup with web2py. One of the function (in controller) is computing intensive, taking up to 10+ seconds to execute. When this function is called (i.e. http://domain/app/func), the app is locked up. Other functions can not be run until this function is done. I remember the book mentions the default web2py config is supposed to have up to 15 threads. So, this behavior shouldn't happen right? Any help is appreciated.
[web2py] Re: running web2py on Android?
did this work? should this perhaps be default in web2py? On Nov 9, 9:33 pm, mdipierro mdipie...@cs.depaul.edu wrote: http://code.google.com/p/android-scripting/issues/detail?id=276 On Nov 9, 6:18 pm, pallav pal...@fielddiagnostics.com wrote: I checked and the line was already commented out. I don't know how to run web2py with the switch -N because I have to run it from inside the interactive python shell by typing import web2py.web2py and hitting enter. What does the switch -N do? I can try to simulate the same effect by modifying th web2py code. The shell output is pasted below. $ export TEMP=/sdcard/ase/extras/python/tmp/ export PYTHONHOME=/data/data/com.google.ase/python $ $ export AP_PORT=45310 export PYTHONPATH=/sdcard/ase/extras/python/:/sdcard/ase/scripts/ /data/data/com.google.ase/python/bin/python $ $ Python 2.6.2 (r262:71600, Sep 19 2009, 11:03:28) [GCC 4.2.1] on linux2 Type help, copyright, credits or license for more information.import web2py.web2py uname: permission denied web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2010 Version 1.88.2 (2010-10-29 23:04:43) Database drivers available: SQLite3 Starting hardcron... Traceback (most recent call last): File stdin, line 1, in module File /sdcard/ase/scripts/web2py/web2py.py, line 23, in module gluon.widget.start(cron=True) File /sdcard/ase/scripts/web2py/gluon/widget.py, line 815, in start logger.warn('GUI not available because Tk library is not installed') File /home/damonkohler/ase_src/python/src/android/python/lib/ python2.6/logging/__init__.py, line 1042, in warning File /home/damonkohler/ase_src/python/src/android/python/lib/ python2.6/logging/__init__.py, line 1142, in _log File /home/damonkohler/ase_src/python/src/android/python/lib/ python2.6/logging/__init__.py, line 1117, in makeRecord File /home/damonkohler/ase_src/python/src/android/python/lib/ python2.6/logging/__init__.py, line 272, in __init__ ImportError: No module named multiprocessing On Nov 8, 11:46 pm, mdipierro mdipie...@cs.depaul.edu wrote: make sure this line in web2py.py # import gluon.import_all is commented. web2py should not need to use multiprocessing. Also run it with -N. On Nov 8, 10:42 pm, pallav pal...@fielddiagnostics.com wrote: I just tried running web2py onandroidand an error regarding the module multiprocessing being missing. It gets called from gluon.widget.start() I will look into the source code tomorrow to see if there is a workatound. I might try porting the multiprocessing module over. Any ideas anyone? I think mobile apps area great way for web2py to take a lead in the python framework world. On Oct 15, 5:15 am, dustin.b dustin.bens...@googlemail.com wrote: i tried to run w2p onandroidwith ASE (androidscripting env). It's been a while since I tried this but i can remember that there was a problem with threads or something like this. w2p seems to use python packages that are not avaible onandroid, didnt remember exactly which one.
[web2py] Re: blocking problem
I do not think this is locking web2py. But there are two possibilities: - if you are using sqlite, the database is locked (sqlite cannot be accessed concurrently) - the user session is locked. This means the user who called the long running process cannot access other actions until his session is unlocked. You can do this manually in th long running action (session._unlock()) assuming it does not save anything in the session. On Nov 10, 11:54 pm, VP vtp2...@gmail.com wrote: I have this problem that I think is related to threading and web2py. I have an apache2 standard setup with web2py. One of the function (in controller) is computing intensive, taking up to 10+ seconds to execute. When this function is called (i.e.http://domain/app/func), the app is locked up. Other functions can not be run until this function is done. I remember the book mentions the default web2py config is supposed to have up to 15 threads. So, this behavior shouldn't happen right? Any help is appreciated.
[web2py] Re: blocking problem
Anyway... a background process may be a better solution (no session problem but you may still have sqlite lock unless you db.commit() manually after each update). On Nov 10, 11:57 pm, mdipierro mdipie...@cs.depaul.edu wrote: I do not think this is locking web2py. But there are two possibilities: - if you are using sqlite, the database is locked (sqlite cannot be accessed concurrently) - the user session is locked. This means the user who called the long running process cannot access other actions until his session is unlocked. You can do this manually in th long running action (session._unlock()) assuming it does not save anything in the session. On Nov 10, 11:54 pm, VP vtp2...@gmail.com wrote: I have this problem that I think is related to threading and web2py. I have an apache2 standard setup with web2py. One of the function (in controller) is computing intensive, taking up to 10+ seconds to execute. When this function is called (i.e.http://domain/app/func), the app is locked up. Other functions can not be run until this function is done. I remember the book mentions the default web2py config is supposed to have up to 15 threads. So, this behavior shouldn't happen right? Any help is appreciated.
[web2py] Re: flow charts
Hey Alexandre, first jsPlumb, now this!... so many choices :) Looks so good as well :) and says easy to use right there on the front page! (love easy to use!). OK, tanks for that as well... I will try them both. Thanks for the tip! Mart :) On Nov 10, 10:08 pm, Alexandre Augusto alllme...@gmail.com wrote: Hey Mart, If you like visual appealing JavaScript Framework you may also be interested in Raphaël—JavaScript Library What is it? Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want to create your own specific chart or image crop and rotate widget, for example, you can achieve it simply and easily with this library. Raphaël ['ræfeɪəl] uses the SVG W3C Recommendation and VML as a base for creating graphics. This means every graphical object you create is also a DOM object, so you can attach JavaScript event handlers or modify them later. Raphaël’s goal is to provide an adapter that will make drawing vector art compatible cross-browser and easy. Raphaël currently supports Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ and Internet Explorer 6.0+. http://raphaeljs.com/ On Nov 10, 10:14 pm, mart msenecal...@gmail.com wrote: Mic, now that's what I'm talking about! That looks awesome! :) Thanks for that! Mart :) On Nov 10, 5:33 pm, Michele Comitini michele.comit...@gmail.com wrote: Hi mart, Not a flowchart app, a library, but you can make very nice charts if you need to show them with web2py: http://morrisonpitt.com/jsPlumb/html/jquery/demo.html mic 2010/11/10 mart msenecal...@gmail.com: Hey, Anybody know of any relatively decent flow chart app out there that would be compatible with web2py? Thanks, Mart :)