You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class ProductVariables(BaseVariables):
def __init__(self, product):
self.product = product
from business_rules import run_all
rules = _some_function_to_receive_from_client()
for product in Products.objects.all():
run_all(rule_list=rules,
defined_variables=ProductVariables(product),
defined_actions=ProductActions(product),
stop_on_first_trigger=True
)
Instead of passing a single product object to this above class from run_all(), is there any way that we can pass whole Query-set of Product model from run_all() method in a way that a bulk support can be added instead of iterating through each product object in run_all() ?
The text was updated successfully, but these errors were encountered:
variables.py
Instead of passing a single product object to this above class from run_all(), is there any way that we can pass whole Query-set of Product model from run_all() method in a way that a bulk support can be added instead of iterating through each product object in run_all() ?
The text was updated successfully, but these errors were encountered: