sphinx_django/db_script.py
author amit
Thu, 30 Sep 2010 11:36:30 +0530
changeset 0 54f784230511
permissions -rw-r--r--
Initial commit of django based commenting system for sphinx. Already has most of the boiler plate code.
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