Skip to content

Commit

Permalink
Merge pull request #33 from jwbixby/master
Browse files Browse the repository at this point in the history
Update the README after the cache removal
  • Loading branch information
simon-weber committed Mar 16, 2016
2 parents 8e17a8b + c9444b4 commit 0dc2e49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ProductVariables(BaseVariables):
last_order = self.product.orders[-1]
return (last_order.expiration_date - datetime.date.today()).days

@string_rule_variable(cache_result=False)
@string_rule_variable()
def current_month(self):
return datetime.datetime.now().strftime("%B")

Expand Down Expand Up @@ -225,9 +225,8 @@ for product in Products.objects.all():

The type represents the type of the value that will be returned for the variable and is necessary since there are different available comparison operators for different types, and the front-end that's generating the rules needs to know which operators are available.

All decorators can optionally take the arguments:
All decorators can optionally take a label:
- `label` - A human-readable label to show on the frontend. By default we just split the variable name on underscores and capitalize the words.
- `cache_result` - Whether to cache the value of the variable for this instance of the variable container object. Defaults to `True` (to avoid re-doing expensive DB queries or computations if you have many rules based on the same variables).

The available types and decorators are:

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from business_rules import __version__ as version

with open('History.rst') as f:
with open('HISTORY.rst') as f:
history = f.read()

description = 'Python DSL for setting up business intelligence rules that can be configured without code'
Expand Down

0 comments on commit 0dc2e49

Please sign in to comment.