Skip to content

Change table rule conditions' syntax #22

@antisvin

Description

@antisvin

We should allow to specify conditions in a more natural form, i.e. right now conditions have to be given as key__op : value but I would prefer key op value:

if:
   - key == 5
   - key > 5
   - key <= 5
   #etc.

The generic format would be:
attr1.[...].attrN [op value]

If [op value] is ommitted, this is equivalent to specifying [== True]

Currently operators that are supported are:

  • bool conversion
  • comparison
  • string operators (contains/icontains)

Key supports lookup for:

  • attr
  • dictionary

Also, I think we should emulate django templates' behavior an call attrs if they are callable. This means that we'll have support for simple function calls (with no arguments). Actually passing parameters can't be expressed in the C-exp bit specification, so it would require a substantial rewrite.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions