concordusapps/python-shield — pull request #2 by CactusCommander (2014-04-23 22:23:14+00:00)
Title: Rework shield to remove the @rule.expression decorator.

This changes most of the way shield works internally. The `Predicate` object has been discarded, and now a variety of parameters are passed into each rule.

Each rule now recieves a sqlalchemy query as a parameter (scoped to the target the rule was declared with) . The rule should return a decorated query representing the result of the rule. Note that this means each rule is a `@rule.expression` style rule now, and evaluating the rule will always hit the database. This can probably be improved in the future, but limiting the scope here makes things easy to reason about for now.

Shield also now only works for sqlalchemy. All references to cross-system stuff has been removed (the django code was never implemented anyway). All other features should still be there though.