Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

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

Changeset 40

Show
Ignore:
Timestamp:
12/17/04 00:32:21
Author:
fumanchu
Message:

1. Added storepypgsql (Postgres) + tests.
2. Minor bugs, omissions in storeado.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/__init__.py

    r39 r40  
    1 """Dejavu is an Object-Relational Mapper. This is version 1.2.5
     1"""Dejavu is an Object-Relational Mapper. This is version 1.2.6
    22 
    33Persisted objects are called "Units", and are served into Sandboxes within 
  • trunk/storage/storeado.py

    r39 r40  
    113113            day, aTime = time_from_com(value) 
    114114            return aTime 
     115     
     116    def coerce_datetime_timedelta(self, value): 
     117        aType, value = value 
     118        if value is None: 
     119            return None 
     120         
     121        days, seconds = divmod(value, 1) 
     122        return datetime.timedelta(days, int(seconds * 86400)) 
    115123     
    116124    coerce_dict = pickle 
     
    422430                    self.imperfect = True 
    423431                    return 
    424             elif isinstance(func, basestring): 
    425                 if func == '<built-in function len>': 
    426                     self.stack.append("Len(" + args[0] + ")") 
    427                     return 
     432            elif isinstance(func, basestring) and func == '<built-in function len>': 
     433                self.stack.append("Len(" + args[0] + ")") 
     434                return 
     435             
     436            if self.stack: 
     437                self.stack[-1] = cannot_represent 
    428438            else: 
    429                 if self.stack: 
    430                     self.stack[-1] = cannot_represent 
    431                 else: 
    432                     self.stack = [cannot_represent] 
    433                 self.imperfect = True 
     439                self.stack = [cannot_represent] 
     440            self.imperfect = True 
    434441     
    435442    def visit_COMPARE_OP(self, lo, hi): 
     
    446453        elif op == '=' and op1 == 'Null': 
    447454            self.stack.append(op2 + " Is Null") 
     455        elif op == '!=' and op2 == 'Null': 
     456            self.stack.append(op1 + " Is Not Null") 
     457        elif op == '!=' and op1 == 'Null': 
     458            self.stack.append(op2 + " Is Not Null") 
    448459        else: 
    449460            if op2.startswith("'") and op2.endswith("'"): 
  • trunk/storage/test_storeado.py

    r39 r40  
    144144              u"([djvAnimal].[Group] = '3') and ([djvAnimal].[Date] > #2/14/2004#)", True) 
    145145         
     146        # None values 
     147        trial(lambda x: x.Date != None and None != x.Date, 
     148              u"([djvAnimal].[Date] Is Not Null) and ([djvAnimal].[Date] Is Not Null)", False) 
     149         
    146150        # In operator 
    147151        trial(lambda x: 'tool' in x.Name or 'tool' in x.Content,