1296 if isinstance(var, ColumnAlias): |
1296 if isinstance(var, ColumnAlias): |
1297 # force sql generation whatever the computed principal |
1297 # force sql generation whatever the computed principal |
1298 principal = 1 |
1298 principal = 1 |
1299 else: |
1299 else: |
1300 principal = var.stinfo.get('principal') |
1300 principal = var.stinfo.get('principal') |
1301 print relation, principal |
|
1302 # we've to return some sql if: |
1301 # we've to return some sql if: |
1303 # 1. visited relation is ored |
1302 # 1. visited relation is ored |
1304 # 2. variable's principal is not this relation and not 1. |
1303 # 2. variable's principal is not this relation and not 1. |
1305 if ored or (principal is not None and principal is not relation |
1304 if ored or (principal is not None and principal is not relation |
1306 and not principal.ored()): |
1305 and not getattr(principal, 'ored', lambda : 0)()): |
1307 # we have to generate unification expression |
1306 # we have to generate unification expression |
1308 if principal is relation: |
1307 if principal is relation: |
1309 # take care if ored case and principal is the relation to |
1308 # take care if ored case and principal is the relation to |
1310 # use the right relation in the unification term |
1309 # use the right relation in the unification term |
1311 _rel = [rel for rel in var.stinfo['rhsrelations'] |
1310 _rel = [rel for rel in var.stinfo['rhsrelations'] |