Hi all,
I am currently working with a friend on a web2py project. This is our first 
time, we do anything with web2py and we managed to build the reddit clone 
and do little improvements, Massimo Di Pierro did in his video tutorials, 
thank you at this point for your great videos.
Now we want to add some other features and have some problems to implement 
2 specific things.

1. We want to display how many comments a post has in the overview of the 
category. But we dont really know how we can access the comments of a post 
and count them.

in our database we have the both tables, post and comment. comment has a 
reference to the post it is connected to. 

2. We have a category called "Updates" and we want that only users in the 
group "admin" can create new posts. Other users shall only be able to 
comment on these posts.

@auth.requires_login()
def create_post():
        category = get_category()
        db.post.category.default = category.id
        form = SQLFORM(db.post).process(next='view_post/[id]');
        return locals()

@auth.requires_membership("admin")

We tried to use an if-statement that it requires an admin membership.

Hopefully, there is anyone out there who can help. Thank you for reading 
this.

Best regards
N. Fischer

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