Ejemplo n.º 1
0
def db_reset():
    db.drop_all()
    db.create_all()
    session.pop('github_token', None)

    flash('All okay', 'info')
    return redirect(url_for('index'))
Ejemplo n.º 2
0
def db_reset():
    db.drop_all()
    db.create_all()
    session.pop('github_token', None)

    flash('All okay', 'info')
    return redirect(url_for('index'))
Ejemplo n.º 3
0
def testdata():
    db.drop_all()
    db.create_all()
    me = User('blah1')
    me.username = '******'
    me.is_member = True

    notme = User('blah3')
    notme.username = '******'
    notme.is_member = True

    ro = User('blah2')
    ro.username = '******'
    ro.is_member = False

    repo1 = Repo()
    repo1.repo_name = 'Mellen\'s first repo'

    db.session.add(me)
    db.session.add(notme)
    db.session.add(ro)
    db.session.add(repo1)
    db.session.commit()

    me.repos.append(repo1)

    ro.members.append(me)
    ro.members.append(notme)

    db.session.commit()

    result = '{0}, {1}, {2}'.format(str(me), str(ro),
                                    str(repo1)).replace('<', '&lt;')
    result += '<br>'
    result += "Mellen's repo is called '{0}'".format(str(me.repos[0])).replace(
        '<', '&lt;')
    result += '<br>'
    result += "{0} is member of {1}".format(str(me), str(me.orgs[0])).replace(
        '<', '&lt;')
    result += '<br>'
    for member in ro.members:
        result += "{0} has member {1} <br>".format(str(ro),
                                                   str(member)).replace(
                                                       '<', '&lt;')
    return result
Ejemplo n.º 4
0
def testdata():
    db.drop_all()
    db.create_all()
    me = User('blah1')
    me.username = '******'
    me.is_member = True
    
    notme = User('blah3')
    notme.username = '******'
    notme.is_member = True

    ro = User('blah2')
    ro.username = '******'
    ro.is_member = False

    repo1 = Repo()
    repo1.repo_name = 'Mellen\'s first repo'

    db.session.add(me)
    db.session.add(notme)
    db.session.add(ro)
    db.session.add(repo1)
    db.session.commit()

    me.repos.append(repo1)

    ro.members.append(me)
    ro.members.append(notme)

    db.session.commit()
    
    result = '{0}, {1}, {2}'.format(str(me), str(ro), str(repo1)).replace('<', '&lt;')
    result += '<br>'
    result += "Mellen's repo is called '{0}'".format(str(me.repos[0])).replace('<', '&lt;')
    result += '<br>'
    result += "{0} is member of {1}".format(str(me), str(me.orgs[0])).replace('<', '&lt;')
    result += '<br>'
    for member in ro.members:
        result += "{0} has member {1} <br>".format(str(ro), str(member)).replace('<', '&lt;')
    return result
Ejemplo n.º 5
0
def db_reset():
    db.drop_all()
    db.create_all()

    return 'ok'