Closed miraculixx closed 9 years ago
Some issues that should be discussed here:
We probably need to add an intermediate model for Rule-Ruleset connection that has a field for specifying Rule ordering for a given Ruleset.
Again, good point. Indeed rule ordering should be by priority
(higher priority => executes first, so sorted descending), as briefly mentioned at the end of #3 (for future). Having an intermediate model would allow to specify priorities per ruleset, which is a good thing.
I suppose that TableRuleset should inherit from Rule rather than Ruleset (same as pyrules.rules classes)
agree, as discussed.
This story will add Django models as a rule store.
Expected behavior
Tasks
Implementation notes
Rule
- represents one specific rule coded in a python module, has attributeslabel
,slug
,description
. A rule has a m2m relationship withRuleset
Ruleset
- a ruleset is a m2m collection of Rules into a named set. Attributename
TableRuleset(Ruleset)
- represents apyrules.TableRuleset
, coded in yaml or json, in attributedefinition
. yml or json format should be detected by the model (use a property, like is_yml or is_json).TableRule
for simplicity of the model. At a later point it maybe useful to have a specific set of django models for table rules (e.g. Variable, Condition, ActionTarget, Translation etc. -- not for now).It shall be possible to get an actual Rule like so: