Tim Lesher wrote:
> On 11/20/05, Patrick Lewis <[EMAIL PROTECTED]> wrote:
> > While this appears to work, as soon as you try to reference
> > Bar.foo_obj, an exception is thrown.
> >
> > Traceback (most recent call last):
> > File "<console>", line 1, in ?
> > File "<string>", line 1, in <lambda>
> > AttributeError: 'Bar' object has no attribute '_SO_class_foo'
>
> I see the same issue. It's interesting that if, in an interactive
> session, I import both models, then manually set Bar._SO_class_foo =
> Foo, everything works.
>
> I haven't figured out how to translate that into a strategy for TG yet.
> --
> Tim Lesher <[EMAIL PROTECTED]>
I've found the following works:
from sqlobject import *
from turbogears.identity.model import somodel
class Report(SQLObject):
title = StringCol()
user = ForeignKey("User")
_SO_class_User = somodel.User