From: Andres F. <an...@an...> - 2005-11-30 14:23:26
|
Hi, Ian Bicking wrote: > It's not really intentional. There's a patch related to this (at > least generally) that might resolve this issue: http://sourceforge.net/tracker/index.php?func=detail&aid=1353728&group_id=74338&atid=540674 > -- I haven't had a chance to really look at it yet, I'm afraid, but > if everything looks good it should go in. Ok, i looked through the patch and applied it. It works, but has a shortcoming. If you define a foreignKey via some_id = SomeCol(..., foreignKey="some") it want to name the foreignKey also as some_id. Which is bad i think. The good thing is, that now you just have to change one line to change the name of the generated variable. To get the old behaviour i had to change this (new col.py line 214): # this is in case of ForeignKey, where we rename the column # and append an ID self.origName = origName or name into this: # this is in case of ForeignKey, where we rename the column # and append an ID self.origName = origName or name[:-2] Yes, this is still not very nice, but it works with the old ids, and is easier to change. And it should be easy to change this into an Style method. For now i had to change id to -3 to work with my scheme, but if you think this should be Style thingie i will make a patch up for it. My current problem is, that i don't see when the origName is directly provided, so i don't know if it has to get changed too. Perhaps i will find some time to look further into it. Andres Freund PS: Sorry Ian, for sending it directly to you, i have another email client at work than at home, so my customized keybindings didnt work. |