My code shown below:

Controller:
def views():
    row= db(db.post.author== auth.user.id).select(db.post.id, db.post.
message, orderby=~db.post.id, limitby=(0,1)).first()
    messages = row.message if row else None
    morecode...


View.html:

<body>
        <div class="chat_window">
        <ul class="messages">
        {{for reply in replies:}}
        <li class="message left appeared">
        <div>
        {{=prettydate(reply.modified_on)}}
        </div>
        <div class="text_wrapper">
        <div class="text">{{=XML(reply.quest, sanitize=True)}}</div>
        </div>
        </li>
        <li class="message right appeared">
        <div>
        {{=prettydate(reply.modified_on)}}
        </div>
        <div class="text_wrapper">
        <div class="text">{{=XML(reply.message, sanitize=True)}}</div>
        </div>
        </li>
        {{pass}}
        </ul>
        <div class="bottom_wrapper clearfix">
        <div class="message_input_wrapper">
        <div class="message_input_wrapper">
        {{=form.custom.begin}}
        <textarea name="message" id="message_input" placeholder="Type your 
message here..."></textarea>
        <button>send</button>
        {{=form.custom.end}}
        </div>
        </div>
        </div>
        </div>
        <div class="message_template">
        <li class="message">
        <div class="message-data-time" ></div>
        <div class="text_wrapper">
        <div class="text"></div>
        </div>
        </li>
        </div>
    </body>

I note that It takes some time before an item is posted to the post table. 
Is there a problem with custom form, is there a better way of working this 
out?
Regards

-- 
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 you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to