Пример #1
0
def main():
    c = Config()
    reddit = c.praw()

    dbconn = DB(c)

    sess = dbconn.session()

    source = sys.argv[1]
    regions = Region.patch_from_json(sess, json_file=source, verbose=True)
Пример #2
0
def main():
    c = Config()
    reddit = c.praw()

    dbconn = DB(c)
    
    sess = dbconn.session()
    
    source = sys.argv[1]
    regions = Region.patch_from_json(sess, json_file=source, verbose=True)
Пример #3
0
def main():
    c = Config()
    reddit = c.praw()

    dbconn = DB(c)
    dbconn.drop_all()
    dbconn.create_all()
    
    sess = dbconn.session()
    
    source = sys.argv[1]
    regions = Region.create_from_json(sess, json_file=source)
    
    stamp()
Пример #4
0
def main():
    c = Config()
    reddit = c.praw()

    dbconn = DB(c)
    dbconn.drop_all()
    dbconn.create_all()

    sess = dbconn.session()

    source = sys.argv[1]
    regions = Region.create_from_json(sess, json_file=source)

    # Create team DB entries
    TeamInfo.create_defaults(sess, c)

    stamp()
Пример #5
0
def create():
    c = Config()

    dbconn = DB(c)

    sess = dbconn.session()

    # Create team DB entries
    TeamInfo.create_defaults(sess, c)
Пример #6
0
def update():
    c = Config()

    dbconn = DB(c)

    sess = dbconn.session()

    # Create team DB entries
    ora = sess.query(TeamInfo).filter_by(id=0).first()
    ora.greeting = """
    Your team welcomes you!
    """

    per = sess.query(TeamInfo).filter_by(id=1).first()
    per.greeting = """
    Your team welcomes you!
    """

    sess.commit()
    print "Greetings updated"