[web2py] Re: JQGrid Plugin with multiple Databases
actually it's the way it works that doesn't look "right" manage all the data within a single function/controller leads to have to pass around with parameters a long list of variables. I had to use jqgrid extensively, also on multiple dbs, with a lot of different configs no way I could use plugin, that is nice for little requirements (also seeing table and column names on vars GETed or POSTed is quite scary...)...anyway, I think that the plugin could be really improved taking the assumption that the data has to be returned by a function in the current controller...something like: def test(): if request.is_ajax() and 'jqgrid_blablabla' in request.vars: set = db1(test.id>0) return jqgrid_data(set) form = SQLFORM('test') blablabla return dict(form=form,message='hello world') the 'jqgrid_blablablablabla' can help if you have multiple ajax request, and this can be inserted into models/jqgrid_plugin.py as... postData : {'jqgrid_blablabla':true} Hope that helps someone figure out how to improve that... I'll try to do it myself but I lack time at the moment...maybe in the next few months. On 11 Ago, 19:54, Skiros wrote: > Massimo the link is bad... > > but is true, that eval sentence open a big door... > > I find another way... > > On 11 ago, 14:10, mdipierro wrote: > > > > > This is a MAJOR security vulnerability: > > >http://?db=os.system('rm-r*') > > > On Aug 11, 11:04 am, Skiros wrote: > > > > I made it work passing the name ofdbtoplugin_jqgridin model and to > > > the controller. In the action "data" find this > > > > table=db[tablename] > > > > and changed with this > > > >db= eval(request.vars.dbor "db") > > > table=db[tablename] > > > > On 8 jul, 07:34, AsmanCom wrote: > > > > > Hi, > > > > > in the editable jqgrid plugin from ebansoftware you can symply pass > > > > the db_name as string: > > > > invoice=plugin_editable_jqgrid(db_invoice.invoice,grid_name='invoice',db_name='db_invoice')) > > > > > I think this is very useful, I am trying to port this functionality to > > > > your plugin, but without success right now. > > > > > Would you further take a look at this? > > > > > THX > > > > > Dieter Asman > > > > > On Jul 7, 1:51 pm, mdipierro wrote: > > > > > > The plugin would need to define a list of possible database and pass > > > > > an index (pointing to an element in the list) during the ajax > > > > > callback. > > > > > > It seems an un-necessary complication to be implemented in general. > > > > > > Massimo > > > > > > On 6 Lug, 11:59, AsmanCom wrote: > > > > > > > Could you advise me a Workaround for that? > > > > > > > THX > > > > > > > Dieter Asman > > > > > > > On 6 Jul., 18:16, mdipierro wrote: > > > > > > > > I see there is a problem. There is no mechanism to pass the > > > > > > > database > > > > > > > via ajax at this time. > > > > > > > > On 6 Lug, 10:39, AsmanCom wrote: > > > > > > > > > Hi, > > > > > > > > > i´ve tried it, but it won´t work. > > > > > > > > > Installed the new Version from > > > > > > > > ->http://www.web2py.com/plugins/default/jqgrid > > > > > > > > > controller-> > > > > > > > > > defjqgrid(): > > > > > > > > return dict(grid=plugin_jqgrid(db_1.maingrid)) > > > > > > > > > model-> > > > > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > > > > > db_1.define_table('maingrid', > > > > > > > > Field('field1', 'string'), > > > > > > > > Field('field2', 'string'), > > > > > > > > Field('field3', 'string'), > > > > > > > > Field('field4', 'string'), > > > > > > > > Field('field5', 'string')) > > > > > > > > > The colnames are right, but the Grid is empty. > > > > > > > > > Do you know how I can get this to work? > > > > > > > > > THX > > > > > > > > > Dieter Asman > > > > > > > > > On 5 Jul., 14:00, mdipierro wrote: > > > > > > > > > > I have fixed it an uploaded. Please give it a try. > > > > > > > > > > On 5 Lug, 04:07, AsmanCom wrote: > > > > > > > > > > > I´ve elready tried to change the > > > > > > > > > > controller/plugin_jqgrid.py, by > > > > > > > > > > replacing > > > > > > > > > > > table=db[tablename] > > > > > > > > > > if request.vars.fieldname: > > > > > > > > > > dbset = > > > > > > > > > >db(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > > > > > else: > > > > > > > > > > dbset =db(table.id>0) > > > > > > > > > > > with: > > > > > > > > > > > table=db_1[tablename] > > > > > > > > > > if request.vars.fieldname: > > > > > > > > > > dbset = > > > > > > > > > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > > > > > else: > > > > > > > > > > dbset = db_1(table.id>0) > > > > > > > > > > > But without success. > > > > > > > > > > > THX > > > > > > > > > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > > > > > > > > > Hi, > > > > > > > > > > > > I try to get theJQGridPlugin > > > > > > > > > > > (http://www.web2py.com/plugins/default/ > > > > > > > > > > >jqgrid) to work with multiple Dat
[web2py] Re: JQGrid Plugin with multiple Databases
Massimo the link is bad... but is true, that eval sentence open a big door... I find another way... On 11 ago, 14:10, mdipierro wrote: > This is a MAJOR security vulnerability: > > http://?db=os.system('rm-r *') > > On Aug 11, 11:04 am, Skiros wrote: > > > I made it work passing the name ofdbtoplugin_jqgridin model and to > > the controller. In the action "data" find this > > > table=db[tablename] > > > and changed with this > > >db= eval(request.vars.dbor "db") > > table=db[tablename] > > > On 8 jul, 07:34, AsmanCom wrote: > > > > Hi, > > > > in the editable jqgrid plugin from ebansoftware you can symply pass > > > the db_name as string: > > > invoice=plugin_editable_jqgrid(db_invoice.invoice,grid_name='invoice',db_name='db_invoice')) > > > > I think this is very useful, I am trying to port this functionality to > > > your plugin, but without success right now. > > > > Would you further take a look at this? > > > > THX > > > > Dieter Asman > > > > On Jul 7, 1:51 pm, mdipierro wrote: > > > > > The plugin would need to define a list of possible database and pass > > > > an index (pointing to an element in the list) during the ajax > > > > callback. > > > > > It seems an un-necessary complication to be implemented in general. > > > > > Massimo > > > > > On 6 Lug, 11:59, AsmanCom wrote: > > > > > > Could you advise me a Workaround for that? > > > > > > THX > > > > > > Dieter Asman > > > > > > On 6 Jul., 18:16, mdipierro wrote: > > > > > > > I see there is a problem. There is no mechanism to pass the database > > > > > > via ajax at this time. > > > > > > > On 6 Lug, 10:39, AsmanCom wrote: > > > > > > > > Hi, > > > > > > > > i´ve tried it, but it won´t work. > > > > > > > > Installed the new Version from > > > > > > > ->http://www.web2py.com/plugins/default/jqgrid > > > > > > > > controller-> > > > > > > > > defjqgrid(): > > > > > > > return dict(grid=plugin_jqgrid(db_1.maingrid)) > > > > > > > > model-> > > > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > > > > db_1.define_table('maingrid', > > > > > > > Field('field1', 'string'), > > > > > > > Field('field2', 'string'), > > > > > > > Field('field3', 'string'), > > > > > > > Field('field4', 'string'), > > > > > > > Field('field5', 'string')) > > > > > > > > The colnames are right, but the Grid is empty. > > > > > > > > Do you know how I can get this to work? > > > > > > > > THX > > > > > > > > Dieter Asman > > > > > > > > On 5 Jul., 14:00, mdipierro wrote: > > > > > > > > > I have fixed it an uploaded. Please give it a try. > > > > > > > > > On 5 Lug, 04:07, AsmanCom wrote: > > > > > > > > > > I´ve elready tried to change the controller/plugin_jqgrid.py, > > > > > > > > > by > > > > > > > > > replacing > > > > > > > > > > table=db[tablename] > > > > > > > > > if request.vars.fieldname: > > > > > > > > > dbset = > > > > > > > > >db(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > > > > else: > > > > > > > > > dbset =db(table.id>0) > > > > > > > > > > with: > > > > > > > > > > table=db_1[tablename] > > > > > > > > > if request.vars.fieldname: > > > > > > > > > dbset = > > > > > > > > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > > > > else: > > > > > > > > > dbset = db_1(table.id>0) > > > > > > > > > > But without success. > > > > > > > > > > THX > > > > > > > > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > I try to get theJQGridPlugin > > > > > > > > > > (http://www.web2py.com/plugins/default/ > > > > > > > > > >jqgrid) to work with multiple Databases. > > > > > > > > > > > Like this: > > > > > > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > > > > > > db_2 = DAL("sqlite://db2.db") > > > > > > > > > > db_3 = DAL("sqlite://db3.db") > > > > > > > > > > >plugin_jqgrid(db_1.shout) > > > > > > > > > > > But the Grid is empty. > > > > > > > > > > > If I do it like that, it works: > > > > > > > > > > >db= DAL("sqlite://db1.db") > > > > > > > > > > >plugin_jqgrid(db.shout) > > > > > > > > > > > How to change the plugin to work with multiple Databases? > > > > > > > > > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it > > > > > > > > > > works but only > > > > > > > > > > for 1DB. > > > > > > > > > > > Can anyone help? > > > > > > > > > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
This is a MAJOR security vulnerability: http://?db=os.system('rm -r *') On Aug 11, 11:04 am, Skiros wrote: > I made it work passing the name of db to plugin_jqgrid in model and to > the controller. In the action "data" find this > > table=db[tablename] > > and changed with this > > db = eval(request.vars.db or "db") > table=db[tablename] > > On 8 jul, 07:34, AsmanCom wrote: > > > Hi, > > > in the editable jqgrid plugin from ebansoftware you can symply pass > > the db_name as string: > > invoice=plugin_editable_jqgrid(db_invoice.invoice,grid_name='invoice',db_name='db_invoice')) > > > I think this is very useful, I am trying to port this functionality to > > your plugin, but without success right now. > > > Would you further take a look at this? > > > THX > > > Dieter Asman > > > On Jul 7, 1:51 pm, mdipierro wrote: > > > > The plugin would need to define a list of possible database and pass > > > an index (pointing to an element in the list) during the ajax > > > callback. > > > > It seems an un-necessary complication to be implemented in general. > > > > Massimo > > > > On 6 Lug, 11:59, AsmanCom wrote: > > > > > Could you advise me a Workaround for that? > > > > > THX > > > > > Dieter Asman > > > > > On 6 Jul., 18:16, mdipierro wrote: > > > > > > I see there is a problem. There is no mechanism to pass the database > > > > > via ajax at this time. > > > > > > On 6 Lug, 10:39, AsmanCom wrote: > > > > > > > Hi, > > > > > > > i´ve tried it, but it won´t work. > > > > > > > Installed the new Version from > > > > > > ->http://www.web2py.com/plugins/default/jqgrid > > > > > > > controller-> > > > > > > > defjqgrid(): > > > > > > return dict(grid=plugin_jqgrid(db_1.maingrid)) > > > > > > > model-> > > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > > > db_1.define_table('maingrid', > > > > > > Field('field1', 'string'), > > > > > > Field('field2', 'string'), > > > > > > Field('field3', 'string'), > > > > > > Field('field4', 'string'), > > > > > > Field('field5', 'string')) > > > > > > > The colnames are right, but the Grid is empty. > > > > > > > Do you know how I can get this to work? > > > > > > > THX > > > > > > > Dieter Asman > > > > > > > On 5 Jul., 14:00, mdipierro wrote: > > > > > > > > I have fixed it an uploaded. Please give it a try. > > > > > > > > On 5 Lug, 04:07, AsmanCom wrote: > > > > > > > > > I´ve elready tried to change the controller/plugin_jqgrid.py, by > > > > > > > > replacing > > > > > > > > > table=db[tablename] > > > > > > > > if request.vars.fieldname: > > > > > > > > dbset = > > > > > > > >db(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > > > else: > > > > > > > > dbset =db(table.id>0) > > > > > > > > > with: > > > > > > > > > table=db_1[tablename] > > > > > > > > if request.vars.fieldname: > > > > > > > > dbset = > > > > > > > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > > > else: > > > > > > > > dbset = db_1(table.id>0) > > > > > > > > > But without success. > > > > > > > > > THX > > > > > > > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > > > > > > > Hi, > > > > > > > > > > I try to get theJQGridPlugin > > > > > > > > > (http://www.web2py.com/plugins/default/ > > > > > > > > >jqgrid) to work with multiple Databases. > > > > > > > > > > Like this: > > > > > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > > > > > db_2 = DAL("sqlite://db2.db") > > > > > > > > > db_3 = DAL("sqlite://db3.db") > > > > > > > > > >plugin_jqgrid(db_1.shout) > > > > > > > > > > But the Grid is empty. > > > > > > > > > > If I do it like that, it works: > > > > > > > > > >db= DAL("sqlite://db1.db") > > > > > > > > > >plugin_jqgrid(db.shout) > > > > > > > > > > How to change the plugin to work with multiple Databases? > > > > > > > > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works > > > > > > > > > but only > > > > > > > > > for 1DB. > > > > > > > > > > Can anyone help? > > > > > > > > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
I made it work passing the name of db to plugin_jqgrid in model and to the controller. In the action "data" find this table=db[tablename] and changed with this db = eval(request.vars.db or "db") table=db[tablename] On 8 jul, 07:34, AsmanCom wrote: > Hi, > > in the editable jqgrid plugin from ebansoftware you can symply pass > the db_name as string: > invoice=plugin_editable_jqgrid(db_invoice.invoice,grid_name='invoice',db_name='db_invoice')) > > I think this is very useful, I am trying to port this functionality to > your plugin, but without success right now. > > Would you further take a look at this? > > THX > > Dieter Asman > > On Jul 7, 1:51 pm, mdipierro wrote: > > > The plugin would need to define a list of possible database and pass > > an index (pointing to an element in the list) during the ajax > > callback. > > > It seems an un-necessary complication to be implemented in general. > > > Massimo > > > On 6 Lug, 11:59, AsmanCom wrote: > > > > Could you advise me a Workaround for that? > > > > THX > > > > Dieter Asman > > > > On 6 Jul., 18:16, mdipierro wrote: > > > > > I see there is a problem. There is no mechanism to pass the database > > > > via ajax at this time. > > > > > On 6 Lug, 10:39, AsmanCom wrote: > > > > > > Hi, > > > > > > i´ve tried it, but it won´t work. > > > > > > Installed the new Version from > > > > > ->http://www.web2py.com/plugins/default/jqgrid > > > > > > controller-> > > > > > > defjqgrid(): > > > > > return dict(grid=plugin_jqgrid(db_1.maingrid)) > > > > > > model-> > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > > db_1.define_table('maingrid', > > > > > Field('field1', 'string'), > > > > > Field('field2', 'string'), > > > > > Field('field3', 'string'), > > > > > Field('field4', 'string'), > > > > > Field('field5', 'string')) > > > > > > The colnames are right, but the Grid is empty. > > > > > > Do you know how I can get this to work? > > > > > > THX > > > > > > Dieter Asman > > > > > > On 5 Jul., 14:00, mdipierro wrote: > > > > > > > I have fixed it an uploaded. Please give it a try. > > > > > > > On 5 Lug, 04:07, AsmanCom wrote: > > > > > > > > I´ve elready tried to change the controller/plugin_jqgrid.py, by > > > > > > > replacing > > > > > > > > table=db[tablename] > > > > > > > if request.vars.fieldname: > > > > > > > dbset = > > > > > > >db(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > > else: > > > > > > > dbset =db(table.id>0) > > > > > > > > with: > > > > > > > > table=db_1[tablename] > > > > > > > if request.vars.fieldname: > > > > > > > dbset = > > > > > > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > > else: > > > > > > > dbset = db_1(table.id>0) > > > > > > > > But without success. > > > > > > > > THX > > > > > > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > > > > > > Hi, > > > > > > > > > I try to get theJQGridPlugin > > > > > > > > (http://www.web2py.com/plugins/default/ > > > > > > > >jqgrid) to work with multiple Databases. > > > > > > > > > Like this: > > > > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > > > > db_2 = DAL("sqlite://db2.db") > > > > > > > > db_3 = DAL("sqlite://db3.db") > > > > > > > > >plugin_jqgrid(db_1.shout) > > > > > > > > > But the Grid is empty. > > > > > > > > > If I do it like that, it works: > > > > > > > > >db= DAL("sqlite://db1.db") > > > > > > > > >plugin_jqgrid(db.shout) > > > > > > > > > How to change the plugin to work with multiple Databases? > > > > > > > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works > > > > > > > > but only > > > > > > > > for 1DB. > > > > > > > > > Can anyone help? > > > > > > > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
I take that as a no ;-) On 7 Jul., 13:51, mdipierro wrote: > The plugin would need to define a list of possible database and pass > an index (pointing to an element in the list) during the ajax > callback. > > It seems an un-necessary complication to be implemented in general. > > Massimo > > On 6 Lug, 11:59, AsmanCom wrote: > > > Could you advise me a Workaround for that? > > > THX > > > Dieter Asman > > > On 6 Jul., 18:16, mdipierro wrote: > > > > I see there is a problem. There is no mechanism to pass the database > > > via ajax at this time. > > > > On 6 Lug, 10:39, AsmanCom wrote: > > > > > Hi, > > > > > i´ve tried it, but it won´t work. > > > > > Installed the new Version from > > > > ->http://www.web2py.com/plugins/default/jqgrid > > > > > controller-> > > > > > def jqgrid(): > > > > return dict(grid=plugin_jqgrid(db_1.maingrid)) > > > > > model-> > > > > > db_1 = DAL("sqlite://db1.db") > > > > > db_1.define_table('maingrid', > > > > Field('field1', 'string'), > > > > Field('field2', 'string'), > > > > Field('field3', 'string'), > > > > Field('field4', 'string'), > > > > Field('field5', 'string')) > > > > > The colnames are right, but the Grid is empty. > > > > > Do you know how I can get this to work? > > > > > THX > > > > > Dieter Asman > > > > > On 5 Jul., 14:00, mdipierro wrote: > > > > > > I have fixed it an uploaded. Please give it a try. > > > > > > On 5 Lug, 04:07, AsmanCom wrote: > > > > > > > I´ve elready tried to change the controller/plugin_jqgrid.py, by > > > > > > replacing > > > > > > > table=db[tablename] > > > > > > if request.vars.fieldname: > > > > > > dbset = > > > > > > db(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > else: > > > > > > dbset = db(table.id>0) > > > > > > > with: > > > > > > > table=db_1[tablename] > > > > > > if request.vars.fieldname: > > > > > > dbset = > > > > > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > else: > > > > > > dbset = db_1(table.id>0) > > > > > > > But without success. > > > > > > > THX > > > > > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > > > > > Hi, > > > > > > > > I try to get the JQGrid Plugin > > > > > > > (http://www.web2py.com/plugins/default/ > > > > > > > jqgrid) to work with multiple Databases. > > > > > > > > Like this: > > > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > > > db_2 = DAL("sqlite://db2.db") > > > > > > > db_3 = DAL("sqlite://db3.db") > > > > > > > > plugin_jqgrid(db_1.shout) > > > > > > > > But the Grid is empty. > > > > > > > > If I do it like that, it works: > > > > > > > > db = DAL("sqlite://db1.db") > > > > > > > > plugin_jqgrid(db.shout) > > > > > > > > How to change the plugin to work with multiple Databases? > > > > > > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but > > > > > > > only > > > > > > > for 1 DB. > > > > > > > > Can anyone help? > > > > > > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
Hi, in the editable jqgrid plugin from ebansoftware you can symply pass the db_name as string: invoice=plugin_editable_jqgrid(db_invoice.invoice,grid_name='invoice',db_name='db_invoice')) I think this is very useful, I am trying to port this functionality to your plugin, but without success right now. Would you further take a look at this? THX Dieter Asman On Jul 7, 1:51 pm, mdipierro wrote: > The plugin would need to define a list of possible database and pass > an index (pointing to an element in the list) during the ajax > callback. > > It seems an un-necessary complication to be implemented in general. > > Massimo > > On 6 Lug, 11:59, AsmanCom wrote: > > > Could you advise me a Workaround for that? > > > THX > > > Dieter Asman > > > On 6 Jul., 18:16, mdipierro wrote: > > > > I see there is a problem. There is no mechanism to pass the database > > > via ajax at this time. > > > > On 6 Lug, 10:39, AsmanCom wrote: > > > > > Hi, > > > > > i´ve tried it, but it won´t work. > > > > > Installed the new Version from > > > > ->http://www.web2py.com/plugins/default/jqgrid > > > > > controller-> > > > > > defjqgrid(): > > > > return dict(grid=plugin_jqgrid(db_1.maingrid)) > > > > > model-> > > > > > db_1 = DAL("sqlite://db1.db") > > > > > db_1.define_table('maingrid', > > > > Field('field1', 'string'), > > > > Field('field2', 'string'), > > > > Field('field3', 'string'), > > > > Field('field4', 'string'), > > > > Field('field5', 'string')) > > > > > The colnames are right, but the Grid is empty. > > > > > Do you know how I can get this to work? > > > > > THX > > > > > Dieter Asman > > > > > On 5 Jul., 14:00, mdipierro wrote: > > > > > > I have fixed it an uploaded. Please give it a try. > > > > > > On 5 Lug, 04:07, AsmanCom wrote: > > > > > > > I´ve elready tried to change the controller/plugin_jqgrid.py, by > > > > > > replacing > > > > > > > table=db[tablename] > > > > > > if request.vars.fieldname: > > > > > > dbset = > > > > > > db(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > else: > > > > > > dbset = db(table.id>0) > > > > > > > with: > > > > > > > table=db_1[tablename] > > > > > > if request.vars.fieldname: > > > > > > dbset = > > > > > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > > else: > > > > > > dbset = db_1(table.id>0) > > > > > > > But without success. > > > > > > > THX > > > > > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > > > > > Hi, > > > > > > > > I try to get theJQGridPlugin > > > > > > > (http://www.web2py.com/plugins/default/ > > > > > > >jqgrid) to work with multiple Databases. > > > > > > > > Like this: > > > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > > > db_2 = DAL("sqlite://db2.db") > > > > > > > db_3 = DAL("sqlite://db3.db") > > > > > > > > plugin_jqgrid(db_1.shout) > > > > > > > > But the Grid is empty. > > > > > > > > If I do it like that, it works: > > > > > > > > db = DAL("sqlite://db1.db") > > > > > > > > plugin_jqgrid(db.shout) > > > > > > > > How to change the plugin to work with multiple Databases? > > > > > > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but > > > > > > > only > > > > > > > for 1 DB. > > > > > > > > Can anyone help? > > > > > > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
The plugin would need to define a list of possible database and pass an index (pointing to an element in the list) during the ajax callback. It seems an un-necessary complication to be implemented in general. Massimo On 6 Lug, 11:59, AsmanCom wrote: > Could you advise me a Workaround for that? > > THX > > Dieter Asman > > On 6 Jul., 18:16, mdipierro wrote: > > > I see there is a problem. There is no mechanism to pass the database > > via ajax at this time. > > > On 6 Lug, 10:39, AsmanCom wrote: > > > > Hi, > > > > i´ve tried it, but it won´t work. > > > > Installed the new Version from > > > ->http://www.web2py.com/plugins/default/jqgrid > > > > controller-> > > > > def jqgrid(): > > > return dict(grid=plugin_jqgrid(db_1.maingrid)) > > > > model-> > > > > db_1 = DAL("sqlite://db1.db") > > > > db_1.define_table('maingrid', > > > Field('field1', 'string'), > > > Field('field2', 'string'), > > > Field('field3', 'string'), > > > Field('field4', 'string'), > > > Field('field5', 'string')) > > > > The colnames are right, but the Grid is empty. > > > > Do you know how I can get this to work? > > > > THX > > > > Dieter Asman > > > > On 5 Jul., 14:00, mdipierro wrote: > > > > > I have fixed it an uploaded. Please give it a try. > > > > > On 5 Lug, 04:07, AsmanCom wrote: > > > > > > I´ve elready tried to change the controller/plugin_jqgrid.py, by > > > > > replacing > > > > > > table=db[tablename] > > > > > if request.vars.fieldname: > > > > > dbset = > > > > > db(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > else: > > > > > dbset = db(table.id>0) > > > > > > with: > > > > > > table=db_1[tablename] > > > > > if request.vars.fieldname: > > > > > dbset = > > > > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > > else: > > > > > dbset = db_1(table.id>0) > > > > > > But without success. > > > > > > THX > > > > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > > > > Hi, > > > > > > > I try to get the JQGrid Plugin > > > > > > (http://www.web2py.com/plugins/default/ > > > > > > jqgrid) to work with multiple Databases. > > > > > > > Like this: > > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > > db_2 = DAL("sqlite://db2.db") > > > > > > db_3 = DAL("sqlite://db3.db") > > > > > > > plugin_jqgrid(db_1.shout) > > > > > > > But the Grid is empty. > > > > > > > If I do it like that, it works: > > > > > > > db = DAL("sqlite://db1.db") > > > > > > > plugin_jqgrid(db.shout) > > > > > > > How to change the plugin to work with multiple Databases? > > > > > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but > > > > > > only > > > > > > for 1 DB. > > > > > > > Can anyone help? > > > > > > > THX
Re: [web2py] Re: JQGrid Plugin with multiple Databases
I am quite interrested to the incorporation of this plugin in the near future... I will read the thread carefully. Thanks to pay attention about this issue. Jonhy On 2010-07-06 12:59, AsmanCom wrote: Could you advise me a Workaround for that? THX Dieter Asman On 6 Jul., 18:16, mdipierro wrote: I see there is a problem. There is no mechanism to pass the database via ajax at this time. On 6 Lug, 10:39, AsmanCom wrote: Hi, i´ve tried it, but it won´t work. Installed the new Version from ->http://www.web2py.com/plugins/default/jqgrid controller-> def jqgrid(): return dict(grid=plugin_jqgrid(db_1.maingrid)) model-> db_1 = DAL("sqlite://db1.db") db_1.define_table('maingrid', Field('field1', 'string'), Field('field2', 'string'), Field('field3', 'string'), Field('field4', 'string'), Field('field5', 'string')) The colnames are right, but the Grid is empty. Do you know how I can get this to work? THX Dieter Asman On 5 Jul., 14:00, mdipierro wrote: I have fixed it an uploaded. Please give it a try. On 5 Lug, 04:07, AsmanCom wrote: I´ve elready tried to change the controller/plugin_jqgrid.py, by replacing table=db[tablename] if request.vars.fieldname: dbset = db(table[request.vars.fieldname]==request.vars.fieldvalue) else: dbset = db(table.id>0) with: table=db_1[tablename] if request.vars.fieldname: dbset = db_1(table[request.vars.fieldname]==request.vars.fieldvalue) else: dbset = db_1(table.id>0) But without success. THX On Jul 5, 11:00 am, AsmanCom wrote: Hi, I try to get the JQGrid Plugin (http://www.web2py.com/plugins/default/ jqgrid) to work with multiple Databases. Like this: db_1 = DAL("sqlite://db1.db") db_2 = DAL("sqlite://db2.db") db_3 = DAL("sqlite://db3.db") plugin_jqgrid(db_1.shout) But the Grid is empty. If I do it like that, it works: db = DAL("sqlite://db1.db") plugin_jqgrid(db.shout) How to change the plugin to work with multiple Databases? P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but only for 1 DB. Can anyone help? THX
[web2py] Re: JQGrid Plugin with multiple Databases
Could you advise me a Workaround for that? THX Dieter Asman On 6 Jul., 18:16, mdipierro wrote: > I see there is a problem. There is no mechanism to pass the database > via ajax at this time. > > On 6 Lug, 10:39, AsmanCom wrote: > > > Hi, > > > i´ve tried it, but it won´t work. > > > Installed the new Version from > > ->http://www.web2py.com/plugins/default/jqgrid > > > controller-> > > > def jqgrid(): > > return dict(grid=plugin_jqgrid(db_1.maingrid)) > > > model-> > > > db_1 = DAL("sqlite://db1.db") > > > db_1.define_table('maingrid', > > Field('field1', 'string'), > > Field('field2', 'string'), > > Field('field3', 'string'), > > Field('field4', 'string'), > > Field('field5', 'string')) > > > The colnames are right, but the Grid is empty. > > > Do you know how I can get this to work? > > > THX > > > Dieter Asman > > > On 5 Jul., 14:00, mdipierro wrote: > > > > I have fixed it an uploaded. Please give it a try. > > > > On 5 Lug, 04:07, AsmanCom wrote: > > > > > I´ve elready tried to change the controller/plugin_jqgrid.py, by > > > > replacing > > > > > table=db[tablename] > > > > if request.vars.fieldname: > > > > dbset = > > > > db(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > else: > > > > dbset = db(table.id>0) > > > > > with: > > > > > table=db_1[tablename] > > > > if request.vars.fieldname: > > > > dbset = > > > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > > > else: > > > > dbset = db_1(table.id>0) > > > > > But without success. > > > > > THX > > > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > > > Hi, > > > > > > I try to get the JQGrid Plugin (http://www.web2py.com/plugins/default/ > > > > > jqgrid) to work with multiple Databases. > > > > > > Like this: > > > > > > db_1 = DAL("sqlite://db1.db") > > > > > db_2 = DAL("sqlite://db2.db") > > > > > db_3 = DAL("sqlite://db3.db") > > > > > > plugin_jqgrid(db_1.shout) > > > > > > But the Grid is empty. > > > > > > If I do it like that, it works: > > > > > > db = DAL("sqlite://db1.db") > > > > > > plugin_jqgrid(db.shout) > > > > > > How to change the plugin to work with multiple Databases? > > > > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but only > > > > > for 1 DB. > > > > > > Can anyone help? > > > > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
I see there is a problem. There is no mechanism to pass the database via ajax at this time. On 6 Lug, 10:39, AsmanCom wrote: > Hi, > > i´ve tried it, but it won´t work. > > Installed the new Version from ->http://www.web2py.com/plugins/default/jqgrid > > controller-> > > def jqgrid(): > return dict(grid=plugin_jqgrid(db_1.maingrid)) > > model-> > > db_1 = DAL("sqlite://db1.db") > > db_1.define_table('maingrid', > Field('field1', 'string'), > Field('field2', 'string'), > Field('field3', 'string'), > Field('field4', 'string'), > Field('field5', 'string')) > > The colnames are right, but the Grid is empty. > > Do you know how I can get this to work? > > THX > > Dieter Asman > > On 5 Jul., 14:00, mdipierro wrote: > > > I have fixed it an uploaded. Please give it a try. > > > On 5 Lug, 04:07, AsmanCom wrote: > > > > I´ve elready tried to change the controller/plugin_jqgrid.py, by > > > replacing > > > > table=db[tablename] > > > if request.vars.fieldname: > > > dbset = > > > db(table[request.vars.fieldname]==request.vars.fieldvalue) > > > else: > > > dbset = db(table.id>0) > > > > with: > > > > table=db_1[tablename] > > > if request.vars.fieldname: > > > dbset = > > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > > else: > > > dbset = db_1(table.id>0) > > > > But without success. > > > > THX > > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > > Hi, > > > > > I try to get the JQGrid Plugin (http://www.web2py.com/plugins/default/ > > > > jqgrid) to work with multiple Databases. > > > > > Like this: > > > > > db_1 = DAL("sqlite://db1.db") > > > > db_2 = DAL("sqlite://db2.db") > > > > db_3 = DAL("sqlite://db3.db") > > > > > plugin_jqgrid(db_1.shout) > > > > > But the Grid is empty. > > > > > If I do it like that, it works: > > > > > db = DAL("sqlite://db1.db") > > > > > plugin_jqgrid(db.shout) > > > > > How to change the plugin to work with multiple Databases? > > > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but only > > > > for 1 DB. > > > > > Can anyone help? > > > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
Hi, i´ve tried it, but it won´t work. Installed the new Version from -> http://www.web2py.com/plugins/default/jqgrid controller-> def jqgrid(): return dict(grid=plugin_jqgrid(db_1.maingrid)) model-> db_1 = DAL("sqlite://db1.db") db_1.define_table('maingrid', Field('field1', 'string'), Field('field2', 'string'), Field('field3', 'string'), Field('field4', 'string'), Field('field5', 'string')) The colnames are right, but the Grid is empty. Do you know how I can get this to work? THX Dieter Asman On 5 Jul., 14:00, mdipierro wrote: > I have fixed it an uploaded. Please give it a try. > > On 5 Lug, 04:07, AsmanCom wrote: > > > I´ve elready tried to change the controller/plugin_jqgrid.py, by > > replacing > > > table=db[tablename] > > if request.vars.fieldname: > > dbset = > > db(table[request.vars.fieldname]==request.vars.fieldvalue) > > else: > > dbset = db(table.id>0) > > > with: > > > table=db_1[tablename] > > if request.vars.fieldname: > > dbset = > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > else: > > dbset = db_1(table.id>0) > > > But without success. > > > THX > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > Hi, > > > > I try to get the JQGrid Plugin (http://www.web2py.com/plugins/default/ > > > jqgrid) to work with multiple Databases. > > > > Like this: > > > > db_1 = DAL("sqlite://db1.db") > > > db_2 = DAL("sqlite://db2.db") > > > db_3 = DAL("sqlite://db3.db") > > > > plugin_jqgrid(db_1.shout) > > > > But the Grid is empty. > > > > If I do it like that, it works: > > > > db = DAL("sqlite://db1.db") > > > > plugin_jqgrid(db.shout) > > > > How to change the plugin to work with multiple Databases? > > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but only > > > for 1 DB. > > > > Can anyone help? > > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
THX, that was damn fast! I´ll try it later and will let you know if it works. Dieter Asman On Jul 5, 2:00 pm, mdipierro wrote: > I have fixed it an uploaded. Please give it a try. > > On 5 Lug, 04:07, AsmanCom wrote: > > > I´ve elready tried to change the controller/plugin_jqgrid.py, by > > replacing > > > table=db[tablename] > > if request.vars.fieldname: > > dbset = > > db(table[request.vars.fieldname]==request.vars.fieldvalue) > > else: > > dbset = db(table.id>0) > > > with: > > > table=db_1[tablename] > > if request.vars.fieldname: > > dbset = > > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > > else: > > dbset = db_1(table.id>0) > > > But without success. > > > THX > > > On Jul 5, 11:00 am, AsmanCom wrote: > > > > Hi, > > > > I try to get the JQGrid Plugin (http://www.web2py.com/plugins/default/ > > > jqgrid) to work with multiple Databases. > > > > Like this: > > > > db_1 = DAL("sqlite://db1.db") > > > db_2 = DAL("sqlite://db2.db") > > > db_3 = DAL("sqlite://db3.db") > > > > plugin_jqgrid(db_1.shout) > > > > But the Grid is empty. > > > > If I do it like that, it works: > > > > db = DAL("sqlite://db1.db") > > > > plugin_jqgrid(db.shout) > > > > How to change the plugin to work with multiple Databases? > > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but only > > > for 1 DB. > > > > Can anyone help? > > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
I have fixed it an uploaded. Please give it a try. On 5 Lug, 04:07, AsmanCom wrote: > I´ve elready tried to change the controller/plugin_jqgrid.py, by > replacing > > table=db[tablename] > if request.vars.fieldname: > dbset = > db(table[request.vars.fieldname]==request.vars.fieldvalue) > else: > dbset = db(table.id>0) > > with: > > table=db_1[tablename] > if request.vars.fieldname: > dbset = > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > else: > dbset = db_1(table.id>0) > > But without success. > > THX > > On Jul 5, 11:00 am, AsmanCom wrote: > > > Hi, > > > I try to get the JQGrid Plugin (http://www.web2py.com/plugins/default/ > > jqgrid) to work with multiple Databases. > > > Like this: > > > db_1 = DAL("sqlite://db1.db") > > db_2 = DAL("sqlite://db2.db") > > db_3 = DAL("sqlite://db3.db") > > > plugin_jqgrid(db_1.shout) > > > But the Grid is empty. > > > If I do it like that, it works: > > > db = DAL("sqlite://db1.db") > > > plugin_jqgrid(db.shout) > > > How to change the plugin to work with multiple Databases? > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but only > > for 1 DB. > > > Can anyone help? > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
This is a design problem.. db should be table._db I will fix it and repost the plugin. On 5 Lug, 04:07, AsmanCom wrote: > I´ve elready tried to change the controller/plugin_jqgrid.py, by > replacing > > table=db[tablename] > if request.vars.fieldname: > dbset = > db(table[request.vars.fieldname]==request.vars.fieldvalue) > else: > dbset = db(table.id>0) > > with: > > table=db_1[tablename] > if request.vars.fieldname: > dbset = > db_1(table[request.vars.fieldname]==request.vars.fieldvalue) > else: > dbset = db_1(table.id>0) > > But without success. > > THX > > On Jul 5, 11:00 am, AsmanCom wrote: > > > Hi, > > > I try to get the JQGrid Plugin (http://www.web2py.com/plugins/default/ > > jqgrid) to work with multiple Databases. > > > Like this: > > > db_1 = DAL("sqlite://db1.db") > > db_2 = DAL("sqlite://db2.db") > > db_3 = DAL("sqlite://db3.db") > > > plugin_jqgrid(db_1.shout) > > > But the Grid is empty. > > > If I do it like that, it works: > > > db = DAL("sqlite://db1.db") > > > plugin_jqgrid(db.shout) > > > How to change the plugin to work with multiple Databases? > > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but only > > for 1 DB. > > > Can anyone help? > > > THX
[web2py] Re: JQGrid Plugin with multiple Databases
I´ve elready tried to change the controller/plugin_jqgrid.py, by replacing table=db[tablename] if request.vars.fieldname: dbset = db(table[request.vars.fieldname]==request.vars.fieldvalue) else: dbset = db(table.id>0) with: table=db_1[tablename] if request.vars.fieldname: dbset = db_1(table[request.vars.fieldname]==request.vars.fieldvalue) else: dbset = db_1(table.id>0) But without success. THX On Jul 5, 11:00 am, AsmanCom wrote: > Hi, > > I try to get the JQGrid Plugin (http://www.web2py.com/plugins/default/ > jqgrid) to work with multiple Databases. > > Like this: > > db_1 = DAL("sqlite://db1.db") > db_2 = DAL("sqlite://db2.db") > db_3 = DAL("sqlite://db3.db") > > plugin_jqgrid(db_1.shout) > > But the Grid is empty. > > If I do it like that, it works: > > db = DAL("sqlite://db1.db") > > plugin_jqgrid(db.shout) > > How to change the plugin to work with multiple Databases? > > P.S if I put "db=db_1" in the model/plugin_jqgrid.py it works but only > for 1 DB. > > Can anyone help? > > THX