Re: [web2py] Re: How to get teh last DB Field data

2017-11-17 Thread Maurice Waka
Thanks! I did exact;y what you said. It worked so well without the js. And am able to get the lest field item posted. Any idea why the js code below does not work?. Because once I use it, that's when i don't get the last posted message.I used the latest web2py. Regards $(function(){

Re: [web2py] Re: How to get teh last DB Field data

2017-11-17 Thread Anthony
On Wednesday, November 15, 2017 at 9:46:34 AM UTC-5, Maurice Waka wrote: > > *controller* > @auth.requires_login() > def view_searches(): > form = SQLFORM(Post) > if form.process().accepted: > #pass > response.flash = 'done' > if request.vars.message: >

Re: [web2py] Re: How to get teh last DB Field data

2017-11-17 Thread Anthony
On Wednesday, November 15, 2017 at 9:51:22 AM UTC-5, Maurice Waka wrote: > > About db refresh, > when i go to the database administration page in the app, and open the > post.db page, i have to manually refresh the page to see the latest > inserted value which does not match with the returned

Re: [web2py] Re: How to get teh last DB Field data

2017-11-16 Thread Maurice Waka
Hi Leonel. I hope you got the details. Regards On 15 Nov 2017 5:22 PM, "Leonel Câmara" wrote: > You probably have some bug in your code. Is the list of messages in a HTML > element with id="target"? > > If you want put the APP here I'll fix it. > > -- > Resources: > -

Re: [web2py] Re: How to get teh last DB Field data

2017-11-15 Thread Maurice Waka
addendum: Post = db.define_table('post', Field('author', 'reference auth_user', default=auth.user_id, writable=False, readable=False), Field('message', 'text', requires=IS_NOT_EMPTY(), default ='', notnull=False), auth.signature

Re: [web2py] Re: How to get teh last DB Field data

2017-11-15 Thread Maurice Waka
About db refresh, when i go to the database administration page in the app, and open the post.db page, i have to manually refresh the page to see the latest inserted value which does not match with the returned value as explained. That's why i was thinking of a way to refresh the db after the

Re: [web2py] Re: How to get teh last DB Field data

2017-11-15 Thread Maurice Waka
*controller* @auth.requires_login() def view_searches(): form = SQLFORM(Post) if form.process().accepted: #pass response.flash = 'done' if request.vars.message: db.post.insert(message = request.vars.message) db.commit() quiz = db(db.post.author ==

[web2py] Re: How to get teh last DB Field data

2017-11-15 Thread Anthony
> controller/default/index.py > ... > form =SQLFORM(Post, formstyle='table3cols') > if request.vars.message: > db.post.insert(message=request.vars.message) > pass > String = '' > for s in db(db.post.author==auth.user.id).select(db.post.ALL): > String = s.message > First, you

[web2py] Re: How to get teh last DB Field data

2017-11-15 Thread Leonel Câmara
You probably have some bug in your code. Is the list of messages in a HTML element with id="target"? If you want put the APP here I'll fix it. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: How to get teh last DB Field data

2017-11-15 Thread Maurice Waka
Something close to this: https://www.daniweb.com/programming/software-development/threads/310925/refresh-data-base-after-inserting-records On 15 Nov 2017 1:33 PM, "Leonel Câmara" wrote: > What are you trying to do exactly? I mean, what's the objective here? > > -- >

[web2py] Re: How to get teh last DB Field data

2017-11-15 Thread Leonel Câmara
What are you trying to do exactly? I mean, what's the objective here? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because

Re: [web2py] Re: How to get teh last DB Field data

2017-11-14 Thread Maurice Waka
What I mean 6if there ate 5 items or rows in the db, a user inputs the sixth item. This goes to form row number 6. I can get or retrieve this row unless I manually refresh the db. Could there be another way too such as getting the item from request.vars if I can't get it from the db? On 15 Nov

Re: [web2py] Re: How to get teh last DB Field data

2017-11-14 Thread Maurice Waka
Done that. Still can't get the last item inserted. I keep getting the second last item updated. On 15 Nov 2017 4:10 AM, "Leonel Câmara" wrote: > I'm not sure I understand what you're doing. However you're not ordering > your results, so, depending on the database you

[web2py] Re: How to get teh last DB Field data

2017-11-14 Thread Leonel Câmara
I'm not sure I understand what you're doing. However you're not ordering your results, so, depending on the database you won't necessarily get ordered results. Try adding a order_by=db.post.id to your select. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -