Esempio n. 1
0
# -*- coding: utf-8 -*-
if False:
    from gluon import CAT, SQLFORM, A, SPAN, URL
    from gluon import current, redirect
    request = current.request
    response = current.response
    session = current.session
    T = current.T
    from db import db, auth
    from dc import application


@auth.requires(lambda: application.canUpdateItem(request.args(0)))
def index():
    """
    Edit/Show package content
    """
    pkg_item = application.getItemByUUID(request.args(0))
    content = db.plugin_package_content(item_id=pkg_item.unique_id)

    form = SQLFORM(db.plugin_package_content, record=content, showid=False)

    if form.process().accepted:
        application.indexItem(pkg_item.unique_id)
        redirect(URL('default', 'index'))

    return locals()


@auth.requires(lambda: application.canReadItem(request.args(0)))
def diff():
Esempio n. 2
0
# -*- coding: utf-8 -*-
if False:
    from gluon import CAT, SQLFORM, A, SPAN, URL
    from gluon import current, redirect
    request = current.request
    response = current.response
    session = current.session
    T = current.T
    from db import db, auth
    from dc import application


@auth.requires(lambda: application.canUpdateItem(request.args(0)))
def index():
    """
    Edit/Show package content
    """
    pkg_item = application.getItemByUUID(request.args(0))
    content = db.plugin_package_content(item_id=pkg_item.unique_id)

    form = SQLFORM(
        db.plugin_package_content,
        record=content,
        showid=False)

    if form.process().accepted:
        application.indexItem(pkg_item.unique_id)
        redirect(URL('default', 'index'))

    return locals()