LOAD Helper produces only "loading..." on fresh install.

25 views
Skip to first unread message

Chris Hepworth

unread,
Dec 2, 2013, 1:41:38 PM12/2/13
to
I have recently installed web2py, so I don't think the issue is out of date files. I have been following the recipe in the documentation, so my code is as follows:

index.html:
{{extend 'layout.html'}}

{{=LOAD('comments','post.load',ajax=True)}}

post.load:
{{for post in comments:}}
<div class="post">
 
On {{=post.created_on}} {{=post.created_by.first_name}}
  says
<span class="post_body">{{=post.f_comment}}</span>
</div>
{{pass}}
{{=form}}
The table definition I used had f_comment in place of body for the main text of the comment.

comments.py:

@auth.requires_login()
def post():
    form
=SQLFORM(db.t_comment).process()
    comments
=db(db.t_comment).select()
   
return dict(form=form,comments=comments)

Loading the page my accessing through app/comments/post.load works fine and the functionality is there. But when the index page loads, it never gets beyond "loading...".

Chris Hepworth

unread,
Dec 2, 2013, 2:41:54 PM12/2/13
to web...@googlegroups.com
I found my error.
Reply all
Reply to author
Forward
0 new messages