> I have a class A that has a foreignkey to class B, but sqlobject-admin
> (list/create) picks them up in the wrong order (A then B), which causes an
> error in sqlobject-admin create because A has a foreignkey to B which
> doesn't exist yet.
>
> class A(SQLObject):
> b=ForeignKey('B')
>
> class B(SQLObject):
> somedata=StringCol()
>
> If i create the tables manually, I have a similar problem trying to drop
> where it tries to drop B first.
There is an open bug for that:
http://sourceforge.net/tracker/index.php?func=detail&aid=1432190&group_id=74338&atid=540672
It was caused by the patch that activated foreign key constraints for
mysql I think. IMHO, a simple workaround which is also "the right
thing" to do, is to rearrange your table declarations so that foreign
key constraints only reference upwards in the file.
--
mvh Björn
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss