Ejemplo n.º 1
0
def kind_add(kindname, values=None, flash=None):
    if values is None:
        values = {}
    kind = get_kind(kindname)
    flash = flash or get_flash()
    edit = False
    return template('admin_kind_add', **locals())
Ejemplo n.º 2
0
def kind_add(kindname, values=None, flash=None):
    if values is None:
        values = {}
    kind = get_kind(kindname)
    flash = flash or get_flash()
    edit = False
    return template('admin_kind_add', **locals())
Ejemplo n.º 3
0
def kind_delete_do(kindname, key):
    kind = get_kind(kindname)
    flash = get_flash()

    instance = kind.get_by_key_name_or_abort(key)
    instance.delete()
    set_flash(SUCCESS, '%s was deleted' % key)
    redirect('/admin/%s/' % kindname)
Ejemplo n.º 4
0
def kind_delete_do(kindname, key):
    kind = get_kind(kindname)
    flash = get_flash()
    
    instance = kind.get_by_key_name_or_abort(key)
    instance.delete()
    set_flash(SUCCESS, '%s was deleted' % key)
    redirect('/admin/%s/' % kindname)
Ejemplo n.º 5
0
def kind_edit(kindname, name, values=None, flash=None):
    if values is None:
        values = {}
    name = stripslashes(name)
    kind = get_kind(kindname)
    obj = kind.get_by_key_name_or_abort(name)
    key_name = obj.key().name()
    assert key_name is not None
    num_parts = len(kind.Meta.key_parts)
    key_parts = key_name.split(u"/")
    i = 0
    for k in kind.Meta.key_parts:
        v = key_parts[i]
        values[k] = v
        i += 1
    for p in kind.properties():
        if not p in values:
            values[p] = str(getattr(obj, p))
    del obj
    flash = flash or get_flash()
    edit = True
    return template('admin_kind_add', **locals())
Ejemplo n.º 6
0
def kind_edit(kindname, name, values=None, flash=None):
    if values is None:
        values = {}
    name = stripslashes(name)
    kind = get_kind(kindname)
    obj = kind.get_by_key_name_or_abort(name)
    key_name = obj.key().name()
    assert key_name is not None
    num_parts = len(kind.Meta.key_parts)
    key_parts = key_name.split(u"/")
    i = 0
    for k in kind.Meta.key_parts:
        v = key_parts[i]
        values[k] = v
        i += 1
    for p in kind.properties():
        if not p in values:
            values[p] = str(getattr(obj, p))
    del obj
    flash = flash or get_flash()
    edit = True
    return template('admin_kind_add', **locals())
Ejemplo n.º 7
0
def kind_index(kindname):
    kind = get_kind(kindname)
    flash = get_flash()
    return template('admin_kind_index', **locals())
Ejemplo n.º 8
0
def index():
    kinds = get_kinds()
    flash = get_flash()
    return template('admin_index', **locals())
Ejemplo n.º 9
0
def kind_delete(kindname, key):
    kind = get_kind(kindname)
    flash = get_flash()
    return template('admin_kind_delete', **locals())
Ejemplo n.º 10
0
def kind_index(kindname):
    kind = get_kind(kindname)
    flash = get_flash()
    return template('admin_kind_index', **locals())
Ejemplo n.º 11
0
def index():
    kinds = get_kinds()
    flash = get_flash()
    return template('admin_index', **locals())
Ejemplo n.º 12
0
def kind_delete(kindname, key):
    kind = get_kind(kindname)
    flash = get_flash()
    return template('admin_kind_delete', **locals())
Ejemplo n.º 13
0
def run_instance(name, flash=None):
    name = stripslashes(name)
    weavrs_instance = models.WeavrsInstance.get_by_key_name_or_abort(name)
    weavrs = weavrs_instance.get_weavrs()
    flash = flash or get_flash()
    return template('frontend_run_instance', **locals())
Ejemplo n.º 14
0
def run(flash=None):
    weavrs_instances = models.WeavrsInstance.all(keys_only=True)
    flash = flash or get_flash()
    return template('frontend_run_index', **locals())
Ejemplo n.º 15
0
def run_instance(name, flash=None):
    name = stripslashes(name)
    weavrs_instance = models.WeavrsInstance.get_by_key_name_or_abort(name)
    weavrs = weavrs_instance.get_weavrs()
    flash = flash or get_flash()
    return template('frontend_run_instance', **locals())
Ejemplo n.º 16
0
def run(flash=None):
    weavrs_instances = models.WeavrsInstance.all(keys_only=True)
    flash = flash or get_flash()
    return template('frontend_run_index', **locals())