Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

I think I've seen this ORM somewhere before...

Changeset 59

Show
Ignore:
Timestamp:
01/21/05 06:29:55
Author:
fumanchu
Message:

Minor cleanups for 1.3 release.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/doc/framework.html

    r58 r59  
    7575        explicitly closed when the application shuts down, add code to 
    7676        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> 
    7789</ul> 
    7890 
  • trunk/doc/storage.html

    r58 r59  
    130130 
    131131<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> 
    133137<ul> 
    134138    <li><b>Class:</b> <tt>dejavu.storage.storepypgsql.StorageManagerPgSQL</tt></li> 
     
    141145<h5>MySQL (MySQLdb)</h5> 
    142146<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). 
    144150    Configuration entries:</p> 
    145151<ul> 
     
    153159<h5>SQLite (pysqlite)</h5> 
    154160<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". 
    156164    Configuration entries:</p> 
    157165<ul> 
     
    184192        subclass.</li> 
    185193</ul> 
    186  
     194<p>The shelve module does not yet support multirecall().</p> 
    187195 
    188196<h4>Middleware</h4> 
     
    200208<h5>Caching Proxy</h5> 
    201209<p>Use this class to persist Units in memory between client connections. 
    202 It usually proxies another Storage Manager. Configuration entries:</p> 
     210It usually proxies another Storage Manager. At this time, the Caching Proxy 
     211doesn't implement distinct() or multirecall(). Configuration entries:</p> 
    203212<ul> 
    204213    <li><b>Class:</b> <tt>dejavu.storage.CachingProxy</tt></li> 
     
    215224this Storage Manager recalls all Units at once upon the first request, 
    216225and won't recall them again from storage. They are "burned" into memory 
    217 for the lifetime of the application. Configuration entries:</p> 
     226for the lifetime of the application. At this time, the Burned Proxy 
     227doesn't implement distinct() or multirecall(). Configuration entries:</p> 
    218228<ul> 
    219229    <li><b>Class:</b> <tt>dejavu.storage.BurnedProxy</tt></li> 
  • trunk/storage/__init__.py

    r58 r59  
    4343    def reserve(self, unit): 
    4444        """Reserve storage space for the Unit.""" 
    45         raise AttributeError 
     45        raise NotImplementedError 
    4646     
    4747    def shutdown(self): 
    4848        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 
    4957 
    5058 
     
    8492        if self.nextstore: 
    8593            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) 
    86104 
    87105 
  • trunk/storage/storesqlite.py

    r58 r59  
    3131     
    3232    def coerce_bool(self, value, coltype): 
     33        # sqlite 2 will return a string, either '0' or '1'. 
    3334        if isinstance(value, basestring): 
    3435            return (value == '1') 
     36        # sqlite 3 will return an int. 
    3537        return bool(value) 
    3638 
  • trunk/storage/zoo_fixture.py

    r58 r59  
    297297        try: 
    298298            store.drop_database() 
    299         except NotImplementedError
     299        except (AttributeError, NotImplementedError)
    300300            pass 
    301301