Exemple #1
0
def reset_all(json_file):
    db.drop_all()
    db.create_all()

    items = json.loads(open(json_file).read())
    for item in items:
        i = ItemBookmark(ptags=item['tags'],
            plink=item['link'], ptitle=item['title'],
            pdescription=item['description'], json=True)
        add_bookmark(i)
Exemple #2
0
def reset_all(json_file):
    db.drop_all()
    db.create_all()

    items = json.loads(open(json_file).read())
    for item in items['bookmarks']:
        i = ItemBookmark(**item)
        add_bookmark(i)
    for item in items['users']:
        i = User(**item)
        add_user(i)
Exemple #3
0
def reset_all(json_file):
    db.drop_all()
    db.create_all()

    items = json.loads(open(json_file).read())
    for item in items:
        i = ItemBookmark(ptags=item['tags'],
                         plink=item['link'],
                         ptitle=item['title'],
                         pdescription=item['description'],
                         json=True)
        add_bookmark(i)