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(){
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:
>
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
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:
> -
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
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
*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 ==
> 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
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)
-
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?
>
> --
>
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
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
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
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)
-
14 matches
Mail list logo