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...<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 don't see anything there that would make things terribly slow. It's probably related to some other code we aren't seeing (maybe even in the models).
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/ydmllZEr2MQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.