Esempio n. 1
0
def table(schema, table, subtable):
    if (  # people can edit their entries but can't create new users
        (request.args.get('edit', None) != "True")
            and ((schema, table)
                 == (config.user_table.database, config.user_table.name))):
        return redirect(url_for('register'))
    elif ((schema, table) == (config.group_table.database,
                              config.group_table.name)):
        return redirect(url_for('registergroup'))
    elif ((schema, table) == (config.assigned_table.database,
                              config.assigned_table.name)):
        return redirect(url_for('assigngroup'))

    if (schema, table) == ('subjects', 'FlyStock'):
        override_permissions = True
    else:
        override_permissions = False

    subtable = request.args.get('subtable', subtable)
    edit_url = url_for('table', schema=schema, table=table, subtable=subtable)
    overwrite_url = url_for('table',
                            schema=schema,
                            table=table,
                            subtable=subtable)

    return form_template(schema,
                         table,
                         subtable,
                         edit_url,
                         overwrite_url,
                         page='table',
                         override_permissions=override_permissions)
Esempio n. 2
0
def genotype():
    schema = 'subjects'
    table = 'FlyGenotype'
    subtable = None
    edit_url = url_for('genotype')
    overwrite_url = url_for('genotype')

    return form_template(schema,
                         table,
                         subtable,
                         edit_url,
                         overwrite_url,
                         page='genotype',
                         override_permissions=True)
Esempio n. 3
0
def entersubject():
    schema = 'subjects'
    table = 'FlySubject'
    subtable = None
    edit_url = url_for('entersubject')
    overwrite_url = url_for('entersubject')

    return form_template(
        schema,
        table,
        subtable,
        edit_url,
        overwrite_url,
        page='entersubject',
        join_tables=[getattr(config['schemata'][schema], 'FlyGenotype')],
        joined_name='subjectgenotype')
Esempio n. 4
0
def cross():
    schema = 'subjects'
    table = 'FlyCross'
    subtable = None
    edit_url = url_for('cross')
    overwrite_url = url_for('cross')
    load_url = url_for('crossload')

    return form_template(
        schema,
        table,
        subtable,
        edit_url,
        overwrite_url,
        page='cross',
        join_tables=[getattr(config['schemata'][schema], 'FlyGenotype')],
        joined_name='crossgenotype',
        load_url=load_url)
Esempio n. 5
0
def stock():
    schema = 'subjects'
    table = 'FlyStock'
    subtable = None
    edit_url = url_for('stock')
    overwrite_url = url_for('stock')

    return form_template(
        schema,
        table,
        subtable,
        edit_url,
        overwrite_url,
        page='stock',
        join_tables=[getattr(config['schemata'][schema], 'FlyGenotype')],
        joined_name='stockgenotype',
        override_permissions=True,
    )