Hi,
Just started creating my first TG project, but I ran in to a problem
with catwalk. When I have a MultipleJoin referencing a ForeignKey
containing an underscore, I get an exception in browse.py. To clarify,
I had the following
(class Email)
from_user = ForeignKey('User')
(class User)
mailbox = MultipleJoin("Email", joinColumn="from_user_id")
Which causes the exception...
raise AttributeError("%s instance has no attribute '%s'" %
(self.soClass.__name__, attr))
AttributeError: Arguement instance has no attribute 'fromID'
I think the cuplrit may be the following code in browse.py
def join_foreign_key(self,column):
foreign_key = '%sID'% column.joinColumn.split('_')[0]
return getattr(column.otherClass.q,foreign_key)
Should that not be an rsplit? It works if I change 'from_user' to
'fromuser'.
Regards,
Will McGugan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---