I just started using SQLObject and I would like to use it with Flask. So I 
figured I would separate the models from the actual database working, similar 
to what Django does.

I create the following function to open up the models files and create the 
tables:

import inspect
import models

def __init__(self):
        members = inspect.getmembers(models, inspect.isclass)
        for name, cls in members:
            if cls.__module__ == 'models':
            try:
                cls.createTable(ifNotExists=True)
            except OperationalError, e:
                raise OperationalError(e)


When I get to this model

class Event(SQLObject):
    event_id    = IntCol( unique = True )
    describ     = StringCol()
    date        = DateTimeCol(default = DateTimeCol.now)
    organizer   = ForeignKey("Organizer", default=None)
    sponsers    = MultipleJoin("Sponser")
    attendees   = RelatedJoin("Attendee")

I get the following error:
    conxt.#sql-d58_2b' (errno: 150)

If I run it again, everything works fine. The first time through the table is 
created, but not the the related tables. 




------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to