~danilo/storm/bug-610492

« back to all changes in this revision

Viewing changes to storm/store.py

  • Committer: Danilo Segan
  • Date: 2010-07-27 15:32:30 UTC
  • Revision ID: danilo@canonical.com-20100727153230-413p9xukkqdiakiw
A simple fix which allows propertycolumns to be of the same type in FindSpec.is_compatible instead of requiring them to be identical.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
from operator import itemgetter
30
30
 
31
31
from storm.info import get_cls_info, get_obj_info, set_obj_info
 
32
from storm.properties import PropertyColumn
32
33
from storm.variables import Variable, LazyValue
33
34
from storm.expr import (
34
35
    Expr, Select, Insert, Update, Delete, Column, Count, Max, Min,
1671
1672
            if is_expr1 != is_expr2:
1672
1673
                return False
1673
1674
            if info1 is not info2:
 
1675
                if type(info1) != type(info2):
 
1676
                    return False
 
1677
                else:
 
1678
                    if type(info1) == PropertyColumn:
 
1679
                        var1 = info1.variable_factory()
 
1680
                        var2 = info2.variable_factory()
 
1681
                        return type(var1) is type(var2)
 
1682
                    else:
 
1683
                        return False
1674
1684
                return False
1675
1685
        return True
1676
1686