I've tested the the same table on another server (which was freshly installed) and no problems occured (used the same SA version). The problem is probably not in SA, rather being somewhere in my setup. I'll have to investingate what setup makes that error occur.
Thanks, -- Andrius Michael Bayer wrote: > i havent forgotten about this one yet, theres probably some probs with > the regexp in mysql.py that was recently changed to receive foreign key > constraints differently. just need to create this table on this end > and run it. in the meantime, feel free to check out reflecttable() in > mysql.py if you have some resources to spare. > > On Aug 1, 2006, at 1:26 AM, Andrius Armonas wrote: > >> Hi, >> >> here we go with full CREATE statement for the table: >> >> CREATE TABLE `WMSWarehouses` ( >> `WarehouseID` int(10) unsigned NOT NULL auto_increment, >> `WarehouseCode` varchar(25) collate utf8_lithuanian_ci NOT NULL >> default '', >> `WarehouseName` varchar(200) collate utf8_lithuanian_ci NOT NULL >> default '', >> `WarehouseLocation` text collate utf8_lithuanian_ci, >> `WebServicesURL` varchar(200) collate utf8_lithuanian_ci NOT NULL >> default '', >> `WarehouseType` enum('CENTRAL','PERIPHERAL') collate >> utf8_lithuanian_ci NOT NULL default 'CENTRAL', >> `IsIndependentDistr` tinyint(1) NOT NULL default '0', >> `InvoiceSeries` varchar(3) collate utf8_lithuanian_ci NOT NULL >> default '', >> `PackingListSeries` varchar(3) collate utf8_lithuanian_ci NOT NULL >> default '', >> `PreliminaryInvoiceSeries` varchar(3) collate utf8_lithuanian_ci NOT >> NULL default '', >> `ExcDiscount` double(12,2) NOT NULL default '0.00', >> `EcoDiscount` double(12,2) NOT NULL default '0.00', >> `RecomPriceDiscount` double(12,2) NOT NULL default '0.00', >> `OwnerGroup` varchar(100) collate utf8_lithuanian_ci NOT NULL >> default '', >> `Details` text collate utf8_lithuanian_ci NOT NULL, >> `PresentWarehouseID` int(10) unsigned default NULL, >> PRIMARY KEY (`WarehouseID`), >> UNIQUE KEY `WarehouseCode` (`WarehouseCode`), >> KEY `WarehouseType` (`WarehouseType`), >> KEY `InvoiceSeries` (`InvoiceSeries`), >> KEY `PackingListSeries` (`PackingListSeries`), >> KEY `PreliminaryInvoiceSeries` (`PreliminaryInvoiceSeries`), >> KEY `IsIndependentDistr` (`IsIndependentDistr`), >> KEY `PresentWarehouseID` (`PresentWarehouseID`), >> CONSTRAINT `WMSWarehouses_ibfk_1` FOREIGN KEY (`PresentWarehouseID`) >> REFERENCES `WMSWarehouses` (`WarehouseID`) ON UPDATE CASCADE >> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_lithuanian_ci >> >> Thanks, >> -- >> Andrius >> >> >> Michael Bayer wrote: >> >>> need to show us the full CREATE statement for the table,as theres >>> something about it which is not supported; autoloading with MySQL >>> works in the general case. >>> >>> On Jul 31, 2006, at 9:09 AM, Andrius Armonas wrote: >>> >>>> Hi, >>>> >>>> autoload feature doesn't seem to work properly. Calling Table(..., >>>> autoload=True) for the first time raises AttributeError error, and for >>>> the second time - no errors seen. >>>> >>>> What I'm doing is: >>>> >>>> fire:~$ python2.4 >>>> Python 2.4.4c0 (#2, Jun 14 2006, 22:35:41) >>>> [GCC 4.1.2 20060613 (prerelease) (Debian 4.1.1-4)] on linux2 >>>> Type "help", "copyright", "credits" or "license" for more information. >>>> >>>>>>> from sqlalchemy import * >>>>>>> engine = create_engine("mysql://...") >>>>>>> meta = BoundMetaData(engine) >>>>>>> wTable = Table('WMSWarehouses', meta, autoload=True) >>>> >>>> Traceback (most recent call last): >>>> File "<stdin>", line 1, in ? >>>> File "build/bdist.linux-i686/egg/sqlalchemy/schema.py", line 97, in >>>> __call__ >>>> File "build/bdist.linux-i686/egg/sqlalchemy/engine/base.py", line >>>> 488, >>>> in reflecttable >>>> File "build/bdist.linux-i686/egg/sqlalchemy/databases/ mysql.py", >>>> line >>>> 345, in reflecttable >>>> File "build/bdist.linux-i686/egg/sqlalchemy/databases/ mysql.py", >>>> line >>>> 361, in moretableinfo >>>> AttributeError: 'array.array' object has no attribute 'strip' >>>> >>>>>>> wTable = Table('WMSWarehouses', meta, autoload=True) >>>>>>> wTable.name >>>> >>>> 'WMSWarehouses' >>>> >>>> As said, using MySQL 4.1, SA 0.2.6. >>>> >>>> Any help? >>>> >>>> Thanks, >>>> -- >>>> Andrius >>>> >>>> -------------------------------------------------------------------- >>>> ----- >>>> Take Surveys. Earn Cash. Influence the Future of IT >>>> Join SourceForge.net's Techsay panel and you'll get the chance to >>>> share your >>>> opinions on IT & business topics through brief surveys -- and earn >>>> cash >>>> http://www.techsay.com/default.php? >>>> page=join.php&p=sourceforge&CID=DEVDEV >>>> _______________________________________________ >>>> Sqlalchemy-users mailing list >>>> Sqlalchemy-users@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users >> >> ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users