hi,

i've just followed Post preview like you have in blogs. on
http://www.web2pyslices.com/main/slices/take_slice/90

model:
db.define_table('post',
                Field('body',
                      'text'
                      )
                )

controller:
def index():
    posts = db(db.post.id > 0).select(orderby=~db.post.id)
    return dict(posts = posts)

view:
{{for post in posts:}}
    {{if len(post.body) > 1000:}}
        {{index = post.body.find("</p>", 1000, -1) + 4}}
        {{post.body = post.body[0:index]}}
        {{=post.body}}

when i tried to change the function on the view, it return an error :

Traceback (most recent call last):
  File "/home/sugizo/web2py/gluon/rocket.py", line 1064, in run
    self.run_app(conn)
  File "/home/sugizo/web2py/gluon/rocket.py", line 1531, in run_app
    self.environ = environ = self.build_environ(sock_file, conn)
  File "/home/sugizo/web2py/gluon/rocket.py", line 1363, in
build_environ
    request = self.read_request_line(sock_file)
  File "/home/sugizo/web2py/gluon/rocket.py", line 1138, in
read_request_line
    raise SocketTimeout("Socket timed out before request.")
SocketTimeout: Socket timed out before request.

is there any idea to solve this?
thank you so much before.

Reply via email to