From 14b99dcf4643022fac5f3e5938b11004bcd2404f 2012-08-03 12:17:49 From: Lance Edgar Date: 2012-08-03 12:17:49 Subject: [PATCH] load Product.regular_price and current_price eagerly --- diff --git a/rattail/db/extension/model.py b/rattail/db/extension/model.py index d659becb1ce8ba7411e3e72dcec267f9b512bac0..2fdcbfb258654281bcb4e0f4d015c133904c6ee2 100644 --- a/rattail/db/extension/model.py +++ b/rattail/db/extension/model.py @@ -714,11 +714,13 @@ Product.prices = relationship( Product.regular_price = relationship( ProductPrice, primaryjoin=Product.regular_price_uuid == ProductPrice.uuid, + lazy='joined', post_update=True) Product.current_price = relationship( ProductPrice, primaryjoin=Product.current_price_uuid == ProductPrice.uuid, + lazy='joined', post_update=True)