Exemple #1
0
              readable=False, writable=False)],
}

managed_html.settings.home_url = URL('web2py_plugins', 'index')
managed_html.settings.home_label = 'Web2py plugins'

managed_html.settings.page_crud = DIV('TODO')

image_crud_keyword = 'managed_html_image_crud'
managed_html.settings.image_crud =LOAD(
    url=URL(args=request.args, vars={image_crud_keyword:True}), ajax=True)

### define tables ##############################################################
managed_html.define_tables()
managed_html.settings.image_comment = '<- upload an image (max file size=10k)'
managed_html.settings.image_requires = [managed_html.is_length(10240, 1), managed_html.is_image()]
managed_html.settings.movie_comment = '<- upload a movie (max file size=200k)'
managed_html.settings.movie_requires = [managed_html.is_length(204800, 1)] # TODO movie validation

table_content = managed_html.settings.table_content
table_file = managed_html.settings.table_file
        
### populate records ###########################################################
import datetime
if db(table_content.created_on<request.now-datetime.timedelta(minutes=60)).count():
    table_content.truncate()
    table_file.truncate()
    session.flash = 'the database has been refreshed'
    redirect(managed_html.edit_url('page1'))

### fake authentication ########################################################