Changeset 59
- Timestamp:
- 01/21/05 06:29:55
- Files:
-
- trunk/doc/framework.html (modified) (1 diff)
- trunk/doc/storage.html (modified) (6 diffs)
- trunk/storage/__init__.py (modified) (2 diffs)
- trunk/storage/storesqlite.py (modified) (1 diff)
- trunk/storage/zoo_fixture.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/doc/framework.html
r58 r59 75 75 explicitly closed when the application shuts down, add code to 76 76 do that here.</li> 77 <li><tt>distinct(self, cls, fields, expr=None):</tt> Recommended. 78 This method must return an iterable of (tuples of) distinct 79 UnitProperty values for the given field(s). The Units from which 80 the values are drawn must be of the supplied class (cls), and must 81 match the Expression (expr), if supplied. If an Expression is not 82 supplied, all stored Units of the specified class must be examined. 83 </li> 84 <li><tt>multirecall(self, *pairs):</tt> Recommended. 85 This method must return an iterable of lists; each item in each list 86 will be a Unit. The Units must be of the supplied class, and 87 must match the Expression, for each (cls, expr) pair in *pairs. 88 </li> 77 89 </ul> 78 90 trunk/doc/storage.html
r58 r59 130 130 131 131 <h5>PostgreSQL (pyPgSQL)</h5> 132 <p>This class was developed against PostgreSQL 8.0.0 rc-1. Configuration entries:</p> 132 <p>This class was developed against 133 PostgreSQL 8.0.0 rc-1 on Win2k, 134 and also tested on 135 PostgreSQL 7.6.6-6 on Debian "sarge". 136 Configuration entries:</p> 133 137 <ul> 134 138 <li><b>Class:</b> <tt>dejavu.storage.storepypgsql.StorageManagerPgSQL</tt></li> … … 141 145 <h5>MySQL (MySQLdb)</h5> 142 146 <p>This class was developed against: 143 mysql Ver 14.7 Distrib 4.1.8, for Win95/Win98 (i32). 147 mysql Ver 14.7 Distrib 4.1.8, for Win95/Win98 (i32), 148 and also tested on 149 mysql Ver 12.22 Distrib 4.0.23, for pc-linux-gnu (i386). 144 150 Configuration entries:</p> 145 151 <ul> … … 153 159 <h5>SQLite (pysqlite)</h5> 154 160 <p>This class was developed against: 155 sqlite 3.0.8 (pysqlite-1.1.6.win32-py2.3) 161 sqlite 3.0.8 (pysqlite-1.1.6.win32-py2.3), 162 and also tested on 163 sqlite 2.8.15-3 on Debian "sarge". 156 164 Configuration entries:</p> 157 165 <ul> … … 184 192 subclass.</li> 185 193 </ul> 186 194 <p>The shelve module does not yet support multirecall().</p> 187 195 188 196 <h4>Middleware</h4> … … 200 208 <h5>Caching Proxy</h5> 201 209 <p>Use this class to persist Units in memory between client connections. 202 It usually proxies another Storage Manager. Configuration entries:</p> 210 It usually proxies another Storage Manager. At this time, the Caching Proxy 211 doesn't implement distinct() or multirecall(). Configuration entries:</p> 203 212 <ul> 204 213 <li><b>Class:</b> <tt>dejavu.storage.CachingProxy</tt></li> … … 215 224 this Storage Manager recalls all Units at once upon the first request, 216 225 and won't recall them again from storage. They are "burned" into memory 217 for the lifetime of the application. Configuration entries:</p> 226 for the lifetime of the application. At this time, the Burned Proxy 227 doesn't implement distinct() or multirecall(). Configuration entries:</p> 218 228 <ul> 219 229 <li><b>Class:</b> <tt>dejavu.storage.BurnedProxy</tt></li> trunk/storage/__init__.py
r58 r59 43 43 def reserve(self, unit): 44 44 """Reserve storage space for the Unit.""" 45 raise AttributeError45 raise NotImplementedError 46 46 47 47 def shutdown(self): 48 48 pass 49 50 def distinct(self, cls, fields, expr=None): 51 """distinct(cls, fields, expr=None) -> Distinct values for given fields.""" 52 raise NotImplementedError 53 54 def multirecall(self, *pairs): 55 """multirecall(*pairs) -> Full inner join units for each (cls, expr) pair.""" 56 raise NotImplementedError 49 57 50 58 … … 84 92 if self.nextstore: 85 93 self.nextstore.reserve(unit) 94 95 def distinct(self, cls, fields, expr=None): 96 """distinct(cls, fields, expr=None) -> Distinct values for given fields.""" 97 if self.nextstore: 98 return self.nextstore.distinct(cls, fields, expr) 99 100 def multirecall(self, *pairs): 101 """multirecall(*pairs) -> Full inner join units for each (cls, expr) pair.""" 102 if self.nextstore: 103 return self.nextstore.multirecall(*pairs) 86 104 87 105 trunk/storage/storesqlite.py
r58 r59 31 31 32 32 def coerce_bool(self, value, coltype): 33 # sqlite 2 will return a string, either '0' or '1'. 33 34 if isinstance(value, basestring): 34 35 return (value == '1') 36 # sqlite 3 will return an int. 35 37 return bool(value) 36 38 trunk/storage/zoo_fixture.py
r58 r59 297 297 try: 298 298 store.drop_database() 299 except NotImplementedError:299 except (AttributeError, NotImplementedError): 300 300 pass 301 301
