Ejemplo n.º 1
1
 def setUp(self):
     app = Flask("tests", static_url_path="/static")
     app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = True
     app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////tmp/test_idb.db"
     db.init_app(app)
     db.app = app
     db.configure_mappers()
     db.create_all()
Ejemplo n.º 2
0
def dbCreate():
    db.configure_mappers()
Ejemplo n.º 3
0
 def migration():
     db.configure_mappers()
     db.create_all()
Ejemplo n.º 4
0
import time
from time import mktime
from datetime import datetime
import json
from sqlalchemy import exists

import os
import re, string

# setting up tables and models
app = Flask(__name__, static_url_path='/static')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///idb.db'
db.init_app(app)
db.app = app
db.configure_mappers()
db.create_all()

# for many to many adding
# Senpai notice me!
# http://docs.sqlalchemy.org/en/latest/orm/tutorial.html#building-a-many-to-many-relationship

# cache the processed data to avoid collision
hashed = {}
cities = {}
tweet_ids = {}

# scan throught our private repo searching for data
json_list = []
for stuff in os.listdir("../cs373-tweetCity/"):
    if stuff.endswith(".json") and stuff.startswith("new"):