Re: [SQLObject] Use a column other than the primary key for a foreignkey...
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2011-02-16 10:38:57
|
On Wed, Feb 16, 2011 at 02:10:41AM -0800, Sam's Lists wrote: > Are there any plans to change that? There is no just because this is the first time the question is raised. I've added it to the TODO list: http://sourceforge.net/mailarchive/forum.php?thread_name=E1PnpY6-00009p-IX%40webwareforpython.org&forum_name=sqlobject-cvs > I assume it's a pretty complicated change, right? At the first glance it seems one needs to change SOForeignKey (and perhaps SOCol), sqlmeta.add/delColumn(); SQLObject._SO_foreignKey() must take into account the id could be any column, not only an id; the current code could be preserved as a shortcut in case otherColumn is id. Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |