~free.ekanayaka/storm/any-expr

« back to all changes in this revision

Viewing changes to storm/database.py

  • Committer: Michael Hudson
  • Date: 2008-05-18 10:22:29 UTC
  • mto: (215.8.12 resultset-groupby-2)
  • mto: This revision was merged to the branch mainline in revision 229.
  • Revision ID: michael.hudson@canonical.com-20080518102229-rvh6oacfe9x1841w
the fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
    def get_one(self):
73
73
        """Fetch one result from the cursor.
74
74
 
75
 
        @raise DisconnectionError: Raised when the connection is lost.
76
 
            Reconnection happens automatically on rollback.
77
 
 
78
75
        The result will be converted to an appropriate format via
79
76
        L{from_database}.
80
77
 
 
78
        @raise DisconnectionError: Raised when the connection is lost.
 
79
            Reconnection happens automatically on rollback.
 
80
 
81
81
        @return: A converted row or None, if no data is left.
82
82
        """
83
83
        row = self._connection._check_disconnect(self._raw_cursor.fetchone)
88
88
    def get_all(self):
89
89
        """Fetch all results from the cursor.
90
90
 
 
91
        The results will be converted to an appropriate format via
 
92
        L{from_database}.
 
93
 
91
94
        @raise DisconnectionError: Raised when the connection is lost.
92
95
            Reconnection happens automatically on rollback.
93
 
 
94
 
        The results will be converted to an appropriate format via
95
 
        L{from_database}.
96
96
        """
97
97
        result = self._connection._check_disconnect(self._raw_cursor.fetchall)
98
98
        if result:
102
102
    def __iter__(self):
103
103
        """Yield all results, one at a time.
104
104
 
 
105
        The results will be converted to an appropriate format via
 
106
        L{from_database}.
 
107
 
105
108
        @raise DisconnectionError: Raised when the connection is lost.
106
109
            Reconnection happens automatically on rollback.
107
 
 
108
 
        The results will be converted to an appropriate format via
109
 
        L{from_database}.
110
110
        """
111
111
        while True:
112
112
            results = self._connection._check_disconnect(