Hi!

I'm trying create table in database, but 'default' option isn't using,
when executing 'paster setup-app development.ini' ...

__init.py__
------------------------

from sqlalchemy import *
from sqlalchemy.databases.mysql import *
from sqlalchemy.ext.assignmapper import assign_mapper
from pylons.database import session_context as ctx

meta = MetaData()

publications = Table('publication', meta,
    Column('id',        Integer, primary_key=True),
    Column('id_category',       Integer),
    Column('type', MSTinyInteger, default=0),
    Column('addpages', MSNVarChar(255)),
    Column('short_name', MSNVarChar(255)),
    Column('recommended', MSTinyInteger),
)

class Publication(object):
    def __str__(self):
        return self.title

record_mapper = assign_mapper(ctx, Publication, publications)

websetup.py
-----------------------

from pylons.database import create_engine

    engine = create_engine(conf['sqlalchemy.dburi'])
    model.meta.connect(engine)
    model.meta.create_all()

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to