What does RTFM mean?
*db:*
> db.define_table('post',
>
> Field('page_id','reference the_page'),
>
> Field('your_name', 'string'),
>
> Field('video','upload', requires=IS_NOT_EMPTY()),
>
> Field('body', 'string'),
>
> Field('created_on','datetime', default=request.now),
>
> Field('created_by', 'string'),
>
> Field('poster' , 'reference auth_user'))
>
> db.post.page_id.readable=db.post.page_id.writable=False
db.post.created_by.readable=db.post.created_by.writable=False
db.post.created_on.readable=db.post.created_on.writable=False
>
*controller : irrelevant code has been omitted *
> @auth.requires_login()
>
> @auth.requires(db(db.auth_user.bank>=199).select())
>
> def show():
>
> db.post.your_name.readable=db.post.your_name.writable=False
>
> this_page = db.the_page(request.args(0,cast=int)) or
>> redirect(URL('index'))
>
> db.post.page_id.default = this_page.id
>
> pagecomments = db(db.post.page_id==this_page.id).select()
>
> form = SQLFORM(db.post).process()
>
> if form.accepted:
>
> db.auth_user.update_or_insert(db.auth_user.id == auth.user.id,
>
> bank=0)
>
> response.flash= T("Form Accepted.")
>
> elif form.errors:
>
> response.flash= T("Error. Please try again")
>
> return dict(page=this_page, comments=pagecomments, form=form)
>
>
>>
*view: irrelevant code has been omitted*
> <h4>
>
> Comments
>
> </h4>
>
> {{for post in comments:}}
>
> <p>
>
> <a href="{{=URL('default', 'post_message',
>> args=post.poster)}}"><i>{{=post.poster}}</i></a>: {{=post.body}}
>
> </p><br>{{=post.video}}
>
> {{pass}}<br><br>
>
> <br>
>
> <h2>
>
> Comment
>
> </h2>{{=form}}<br><br>
>
> </center>
>
> <br>
>
> <br>
>
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.