I have: (sqlAlchemy 0.5rc1)

 

class DavBaseClass(DeclarativeMeta):

    def __init__(self,ClassName,Bases,dict_):

        dict_['creationdate']           = Column(DateTime, default =
datetime.now, quote=True)

        dict_['displayname']            = Column(Unicode(255)
quote=True)

        dict_['getcontentlanguage']     = Column(Unicode(50) quote=True)

        self.getcontentlength           =
getattr(self,'_getcontentlength')

        dict_['getcontenttype']         = Column(Unicode(50) quote=True)

        dict_['getetag']                = Column(Unicode(20) quote=True)

        dict_['getlastmodified']        = Column(DateTime quote=True)

        dict_['resourcetype']           = Column(Unicode(50) quote=True)

        dict_['source']                 = Column(Unicode() quote=True)

        

        return DeclarativeMeta.__init__(self,ClassName,Bases,dict_)


 

   def _getcontentlength(self):

        return len(self.content) 

------------------------------------------------------------------------
-

 

in my other module I have:

------------------------------------------------------------------------
-

 

Base = declarative_base(metaclass=DavBaseClass)

 

class Javascript(Base):

    __tablename__       = "Javascript"

    Id                  = Column(Integer, primary_key = True)

    Source              = Column(Unicode())

    Minified            = Column(Unicode())

------------------------------------------------------------------------
-

 

In my create_all I get an error and the echo says:

------------------------------------------------------------------------
-

 

CREATE TABLE `Javascript` (

            `Id` INTEGER NOT NULL AUTO_INCREMENT, 

            `Source` VARCHAR, 

            `Minified` VARCHAR, 

            creationdate DATETIME, 

            displayname VARCHAR(255), 

            getcontentlanguage VARCHAR(50), 

            getcontenttype VARCHAR(50), 

            getetag VARCHAR(20), 

            getlastmodified DATETIME, 

            resourcetype VARCHAR(50), 

            source VARCHAR, 

            PRIMARY KEY (`Id`)

)

------------------------------------------------------------------------
-

Please note that the columnnames from DavBaseClass are not quoted in the
CREATE TABLE QUERY....

 

Any ideas?

 

Kind regards,

 

Martijn Moeling


--~--~---------~--~----~------------~-------~--~----~
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