Rewriting of a cryptic comment.

This commit is contained in:
Mikaël Ates 2011-08-26 11:43:45 +02:00
parent 1c7df14986
commit 463985b73a
1 changed files with 9 additions and 4 deletions

View File

@ -340,10 +340,15 @@ class AbacRule(models.Model):
predicates2 = {}
expression = self.expression
'''
Pb if a predicate id is equal to value.
The value of the predicate will be substitue with a predicate
with that id.
Solution: make a first substitution with unique identifiers.
Here we substitute primary keys with the predicate description.
The substitution might fail if some descriptions contains
primary keys since with an iterative substitution, a
primary key resulting from a previsous substitution would be
replaced by another description.
To prevent this we realize a two-round substitution with unique
identifiers.
'''
for p in Predicate.objects.filter(rule=self):
rdm_str = ''.join(\