Re: [web2py] Re: SQLFORM Next Item in Database
Thanks! I'll give that a shot. On Wed, Jan 9, 2013 at 6:07 PM, Derek wrote: > Well, perhaps you could have a function called 'getNextID' which would > query the database for the next higher ID value. > > > On Wednesday, January 9, 2013 11:15:21 AM UTC-7, D.P. wrote: > >> I considered that idea, but the selection from the larger database may >> not always be consecutive in ID value. In that scenario, a user may end up >> editing an entry that the shouldn't have been looking at in the first place. >> >> Good suggestion though. >> >> >> On Tue, Jan 8, 2013 at 3:57 PM, Derek wrote: >> >>> It seems to me that you could add a 'next' button on that page, which >>> would take request.args(0)+1 and formulate your HREF that way. >>> >>> >>> On Tuesday, January 8, 2013 2:43:46 PM UTC-7, D.P. wrote: I'm using solidtable to pull a selection from a database and display that selection (with the ability to edit the db entry) to the user. I added an extra column with the code: extracolumns = [{'label': A('Edit', _href='#'), 'content': lambda row, rc: A('Edit', _href= 'display_database/%s' % row.id)} ] which calls the function using sqlform def display_database(): record = db.studentGrades(request.args(0)) or redirect(URL( 'back_home')) form = SQLFORM(db.studentGrades, record) if form.process().accepted: response.flash = 'Updated Student Record' redirect(URL(r=request, f='back_home')) elif form.errors: response.flash = 'Form has errors!' return dict(form=form) It would be much easier for the user if they could click a "next" button to scroll through the selection. Is there functionality in sqlform or some other way to allow users to scroll through only a selection within a database? So instead of returning to the solidtable view, the user could just edit the next row in the database selection. dp >>> -- >>> >>> >>> >>> >> >> >> >> -- >> D.P. >> > -- > > > > -- D.P. --
Re: [web2py] Re: SQLFORM Next Item in Database
Well, perhaps you could have a function called 'getNextID' which would query the database for the next higher ID value. On Wednesday, January 9, 2013 11:15:21 AM UTC-7, D.P. wrote: > > I considered that idea, but the selection from the larger database may not > always be consecutive in ID value. In that scenario, a user may end up > editing an entry that the shouldn't have been looking at in the first place. > > Good suggestion though. > > > On Tue, Jan 8, 2013 at 3:57 PM, Derek >wrote: > >> It seems to me that you could add a 'next' button on that page, which >> would take request.args(0)+1 and formulate your HREF that way. >> >> >> On Tuesday, January 8, 2013 2:43:46 PM UTC-7, D.P. wrote: >>> >>> I'm using solidtable to pull a selection from a database and display >>> that selection (with the ability to edit the db entry) to the user. I >>> added an extra column with the code: >>> >>> extracolumns = [{'label': A('Edit', _href='#'), >>> 'content': lambda row, rc: A('Edit', _href= >>> 'display_database/%s' % row.id)} >>> ] >>> >>> which calls the function using sqlform >>> >>> def display_database(): >>> record = db.studentGrades(request.args(**0)) or redirect(URL( >>> 'back_home')) >>> form = SQLFORM(db.studentGrades, record) >>> if form.process().accepted: >>> response.flash = 'Updated Student Record' >>> redirect(URL(r=request, f='back_home')) >>> elif form.errors: >>> response.flash = 'Form has errors!' >>> return dict(form=form) >>> >>> >>> >>> It would be much easier for the user if they could click a "next" button >>> to scroll through the selection. Is there functionality in sqlform or some >>> other way to allow users to scroll through only a selection within a >>> database? So instead of returning to the solidtable view, the user could >>> just edit the next row in the database selection. >>> >>> dp >>> >> -- >> >> >> >> > > > > -- > D.P. > --
Re: [web2py] Re: SQLFORM Next Item in Database
I considered that idea, but the selection from the larger database may not always be consecutive in ID value. In that scenario, a user may end up editing an entry that the shouldn't have been looking at in the first place. Good suggestion though. On Tue, Jan 8, 2013 at 3:57 PM, Derek wrote: > It seems to me that you could add a 'next' button on that page, which > would take request.args(0)+1 and formulate your HREF that way. > > > On Tuesday, January 8, 2013 2:43:46 PM UTC-7, D.P. wrote: >> >> I'm using solidtable to pull a selection from a database and display that >> selection (with the ability to edit the db entry) to the user. I added an >> extra column with the code: >> >> extracolumns = [{'label': A('Edit', _href='#'), >> 'content': lambda row, rc: A('Edit', _href= >> 'display_database/%s' % row.id)} >> ] >> >> which calls the function using sqlform >> >> def display_database(): >> record = db.studentGrades(request.args(**0)) or redirect(URL( >> 'back_home')) >> form = SQLFORM(db.studentGrades, record) >> if form.process().accepted: >> response.flash = 'Updated Student Record' >> redirect(URL(r=request, f='back_home')) >> elif form.errors: >> response.flash = 'Form has errors!' >> return dict(form=form) >> >> >> >> It would be much easier for the user if they could click a "next" button >> to scroll through the selection. Is there functionality in sqlform or some >> other way to allow users to scroll through only a selection within a >> database? So instead of returning to the solidtable view, the user could >> just edit the next row in the database selection. >> >> dp >> > -- > > > > -- D.P. --
[web2py] Re: SQLFORM Next Item in Database
It seems to me that you could add a 'next' button on that page, which would take request.args(0)+1 and formulate your HREF that way. On Tuesday, January 8, 2013 2:43:46 PM UTC-7, D.P. wrote: > > I'm using solidtable to pull a selection from a database and display that > selection (with the ability to edit the db entry) to the user. I added an > extra column with the code: > > extracolumns = [{'label': A('Edit', _href='#'), > 'content': lambda row, rc: A('Edit', _href= > 'display_database/%s' % row.id)} > ] > > which calls the function using sqlform > > def display_database(): > record = db.studentGrades(request.args(0)) or redirect(URL('back_home' > )) > form = SQLFORM(db.studentGrades, record) > if form.process().accepted: > response.flash = 'Updated Student Record' > redirect(URL(r=request, f='back_home')) > elif form.errors: > response.flash = 'Form has errors!' > return dict(form=form) > > > > It would be much easier for the user if they could click a "next" button > to scroll through the selection. Is there functionality in sqlform or some > other way to allow users to scroll through only a selection within a > database? So instead of returning to the solidtable view, the user could > just edit the next row in the database selection. > > dp > --