~certify-web-dev/storm/certify-staging

« back to all changes in this revision

Viewing changes to storm/store.py

  • Committer: Certification
  • Date: 2011-05-19 21:36:41 UTC
  • mfrom: (360.2.2 certify-storm)
  • Revision ID: certification@macaroni-20110519213641-cc700r26gncopl68
Merged from trunk r362.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from storm.variables import Variable, LazyValue
33
33
from storm.expr import (
34
34
    Expr, Select, Insert, Update, Delete, Column, Count, Max, Min,
35
 
    Avg, Sum, Eq, And, Asc, Desc, compile_python, compare_columns, SQLRaw,
 
35
    Avg, Sum, Eq, And, Asc, Desc, compile_python, compare_columns,
36
36
    Union, Except, Intersect, Alias, SetExpr)
37
37
from storm.exceptions import (
38
38
    WrongStoreError, NotFlushedError, OrderLoopError, UnorderedError,
654
654
        """Perform cache validation for the given obj_info."""
655
655
        where = compare_columns(obj_info.cls_info.primary_key,
656
656
                                obj_info["primary_vars"])
657
 
        result = self._connection.execute(Select(SQLRaw("1"), where))
658
 
        if not result.get_one():
 
657
        result = self._connection.execute(Select(Count(), where))
 
658
        if not result.get_one()[0]:
659
659
            raise LostObjectError("Object is not in the database anymore")
660
660
        obj_info.pop("invalidated", None)
661
661