One thing you can do...

Let's say,

Table1 is post
Table2 is comment

When you render the comment form

form = SQLFORM(db.comment).process()

I am assuming you want to comment after the post is processed which make 
sense.

Here you can invoke a conditional statement like this.

post_time = db.post.created_on;
comment_time = db.comment.created_on;

if (comment_time > post_time +" whatever time you want to allow user")
response.flash('you have passed the time I allocated to comment on my post')

else
   If process.accpted():
    go through the rest. 

Just some thoughts. You need to work through the syntax.





On Friday, June 5, 2015 at 9:32:39 AM UTC-4, 黄祥 wrote:
>
> it's so difficult without seeing any code, but you can use timedelta for it
> e.g. not tested
> duedate = blog.created_by + datetime.timedelta(7)
> editable = True if request.now < duedate else False
>
> best regards,
> stifan
>

-- 
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