sphinx_django/db_script.py
author Puneeth Chaganti <punchagan@fossee.in>
Sun, 30 Jan 2011 12:32:06 +0530
changeset 4 e6e33366df0f
parent 0 54f784230511
permissions -rw-r--r--
Clean up backup files and .pyc files.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
     1
from sqlalchemy import *
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
     2
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
     3
db = create_engine('sqlite:///test.db')
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
     4
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
     5
db.echo = False  # Try changing this to True and see what happens
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
     6
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
     7
metadata = MetaData(db)
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
     8
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
     9
chapter = Table('Chapter', metadata,
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
    10
    Column('id', Integer, primary_key=True),
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
    11
    Column('name', String(40)),
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
    12
)
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
    13
chapter.create()
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
    14
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
    15
i = chapter.insert()
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
    16
i.execute(name='basic_func')
54f784230511 Initial commit of django based commenting system for sphinx. Already has
amit
parents:
diff changeset
    17