django-flashcard
django-flashcard copied to clipboard
Ship with a default database
This is a really great idea for a simple django application. But getting started is difficult because it doesn't come with a default database or a script to setup the database.
I think it should ship with a sqlite3 database with one or more sample flashcard sets already installed. Something like the below to generate the db, except with additional table creation constraints like primary key and foreign key.
import sqlite3
conn = sqlite3.connect('db.sqlite3')
cursor = conn.cursor()
cursor.execute("CREATE TABLE flashcard_set(id integer PRIMARY KEY, name text, color text);"
cursor.execute("CREATE TABLE flashcard_card(id integer, set_id text, front text, back text);")