コード例 #1
0
def index():
    form = SQLFORM(table, upload=URL('download'))
    if form.accepts(request.vars, session):
        session.flash = 'submitted %s' % form.vars
        redirect(URL('index'))
    
    unmark_not_empty(table)
    records = db(table.id>0).select(orderby=~table.id)
    records = SQLTABLE(records, headers="labels",
                       upload=URL('download'), linkto=lambda f, t, r: URL('edit', args=f))
    return dict(form=form, records=records, tests=[A('test_load', _href=URL('test'))])
コード例 #2
0
def index():
    form = SQLFORM(table, upload=URL('download'))
    if form.accepts(request.vars, session):
        session.flash = 'submitted %s' % form.vars
        redirect(URL('index'))
    
    unmark_not_empty(table)
    records = db(table.id > 0).select(orderby=~table.id)
    records = SQLTABLE(records, headers="labels",
                       upload=URL('download'), linkto=lambda f, t, r: URL('edit', args=f))
    return dict(form=form, records=records, tests=[A('test_load', _href=URL('test'))])
コード例 #3
0
def index():
################################ The core ######################################
    # Modify the filed labels of the db.product attaching not-empty markers
    mark_not_empty(db.product)
    form_marked = SQLFORM(db.product, separator='')
    # Unmark the filed labels
    unmark_not_empty(db.product)
    form_unmarked = SQLFORM(db.product, separator='')
################################################################################

    if form_marked.accepts(request.vars, session):
        session.flash = 'submitted %s' % form_marked.vars
        redirect(URL('index'))
    if form_unmarked.accepts(request.vars, session, formname='unmarked'):
        session.flash = 'submitted %s' % form_unmarked.vars
        redirect(URL('index'))
    style = STYLE("""input[type="text"], select, textarea {width:100%; max-height: 50px;} 
                     .w2p_fw {padding-right: 20px; max-width:200px;}
                     .w2p_fl {background: #eee;}""")
    return dict(form_marked=DIV(style, form_marked), 
                form_unmarked=form_unmarked)
コード例 #4
0
def index():
    ################################ The core ######################################
    # Modify the filed labels of the db.product attaching not-empty markers
    mark_not_empty(db.product)
    form_marked = SQLFORM(db.product, separator='')
    # Unmark the filed labels
    unmark_not_empty(db.product)
    form_unmarked = SQLFORM(db.product, separator='')
    ################################################################################

    if form_marked.accepts(request.vars, session):
        session.flash = 'submitted %s' % form_marked.vars
        redirect(URL('index'))
    if form_unmarked.accepts(request.vars, session, formname='unmarked'):
        session.flash = 'submitted %s' % form_unmarked.vars
        redirect(URL('index'))
    style = STYLE(
        """input[type="text"], select, textarea {width:100%; max-height: 50px;}
                     .w2p_fw {padding-right: 20px; max-width:200px;}
                     .w2p_fl {background: #eee;}
                     .not_empty {color:#d00;}""")
    return dict(form_marked=DIV(style, form_marked),
                form_unmarked=form_unmarked)
コード例 #5
0
ファイル: plugin_solidgrid.py プロジェクト: tazjel/sqlabs
 def unmark_not_empty(self, table, marker=None):
     from plugin_notemptymarker import unmark_not_empty
     return unmark_not_empty(table)
コード例 #6
0
 def unmark_not_empty(self, table, marker=None):
     from plugin_notemptymarker import unmark_not_empty
     return unmark_not_empty(table)