What is the best way to create a one-to-one relationship in SQLAlchemy using declarative?
I have two tables, foo
and bar
, and I want foo.bar_id
to link to bar
. The catch is that this is a one-way one-to-one relationship. bar
must not know anything about foo
. For every foo, there will be one and only one bar
.
Ideally, after selecting a foo, I could do something like this:
myfoo.bar.whatever = 5
What's the best way to accomplish this using declarative?