well if only one relationship() has the foreign(Transaction.schema), then it
doesn't conflict with anything else.
I'd still take it off though for consistency
On Mon, Dec 28, 2020, at 1:34 PM, sector119 wrote:
> Thanks!
>
> service = relationship(*'Service'*, primaryjoin=*'and_(Service.schema
Thanks!
service = relationship('Service', primaryjoin='and_(Service.schema ==
Transaction.schema, Service.id == foreign(Transaction.service_id))')
eliminates the error
But why I have no need to do the same with organization = relationship(...)
?
Because Service model references Organization on
On Mon, Dec 28, 2020, at 12:37 PM, sector119 wrote:
> Thank You, Mike,
>
> Do you mean that I have to remove all foreign() annotations from all my
> relationships like this?
> service = relationship(*'Service'*, primaryjoin=*'and_(Service.schema ==
> Transaction.schema, Service.id == Transacti
>>> is the above possible? or an error condition?
I don't want to restrict that case
>>> overall, if the plan is that "schema" will match across all the objects
involved, and your application will make sure those are all set as needed,
just
>>> remove the foreign() annotation from the Transac
Thank You, Mike,
Do you mean that I have to remove all foreign() annotations from all my
relationships like this?
service = relationship('Service', primaryjoin='and_(Service.schema ==
Transaction.schema, Service.id == Transaction.service_id)')
organization = relationship('Organization',
primary
by having foreign() on the Transaction.schema column, that means when you do
this:
t1 = Transaction()
t1.service = some_service()
the ORM is being instructed to copy some_service.schema over to t1.schema.
Because "foreign" means "this is the column that mirrors the value of a
canonical valu