sphinx_django/db_script.py
author amit
Fri, 15 Oct 2010 15:59:28 +0530
changeset 2 f5e18f8ed036
parent 0 54f784230511
permissions -rw-r--r--
Changes to account for a new way of keeping ids ... Uses the whole path rather than just file name

from sqlalchemy import *

db = create_engine('sqlite:///test.db')

db.echo = False  # Try changing this to True and see what happens

metadata = MetaData(db)

chapter = Table('Chapter', metadata,
    Column('id', Integer, primary_key=True),
    Column('name', String(40)),
)
chapter.create()

i = chapter.insert()
i.execute(name='basic_func')