File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1150,7 +1150,7 @@ class ViewResults(object):
1150
1150
def __init__ (self , view , options ):
1151
1151
self .view = view
1152
1152
self .options = options
1153
- self ._rows = self ._total_rows = self ._offset = None
1153
+ self ._rows = self ._total_rows = self ._offset = self . _update_seq = None
1154
1154
1155
1155
def __repr__ (self ):
1156
1156
return '<%s %r %r>' % (type (self ).__name__ , self .view , self .options )
@@ -1179,6 +1179,7 @@ def _fetch(self):
1179
1179
self ._rows = [wrapper (row ) for row in data ['rows' ]]
1180
1180
self ._total_rows = data .get ('total_rows' )
1181
1181
self ._offset = data .get ('offset' , 0 )
1182
+ self ._update_seq = data .get ('update_seq' )
1182
1183
1183
1184
@property
1184
1185
def rows (self ):
@@ -1214,6 +1215,20 @@ def offset(self):
1214
1215
self ._fetch ()
1215
1216
return self ._offset
1216
1217
1218
+ @property
1219
+ def update_seq (self ):
1220
+ """The database update sequence that the view reflects.
1221
+
1222
+ The update sequence is included in the view result only when it is
1223
+ explicitly requested using the `update_seq=true` query option.
1224
+ Otherwise, the value is None.
1225
+
1226
+ :rtype: `int` or `NoneType` depending on the query options
1227
+ """
1228
+ if self ._rows is None :
1229
+ self ._fetch ()
1230
+ return self ._update_seq
1231
+
1217
1232
1218
1233
class Row (dict ):
1219
1234
"""Representation of a row as returned by database views."""
You can’t perform that action at this time.
0 commit comments