Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

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

Changeset 382

Show
Ignore:
Timestamp:
01/09/07 07:18:41
Author:
fumanchu
Message:

Fix to make_source for MySQL (which doesn't have a bool datatype).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/storage/db.py

    r381 r382  
    782782        for cname, c in table.iteritems(): 
    783783            ptype = self.db.python_type(c.dbtype) 
     784            if ptype == int and c.hints.get('bytes') in (1, '1'): 
     785                # This is probably a bool 
     786                ptype = bool 
     787                del c.hints['bytes'] 
    784788            p = AutoUnitClass.set_property(cname, ptype) 
    785789            if c.autoincrement: 
     
    830834        for cname, c in table.iteritems(): 
    831835            ptype = self.db.python_type(c.dbtype) 
     836            if ptype == int and c.hints.get('bytes') in (1, '1'): 
     837                # This is probably a bool 
     838                ptype = bool 
     839                del c.hints['bytes'] 
     840             
    832841            mod = ptype.__module__ 
    833842            if mod == '__builtin__': 
  • trunk/test/zoo_fixture.py

    r381 r382  
    12031203        self.assertIn(source, "    sequencer = UnitSequencer()") 
    12041204         
    1205         if not ("    identifiers = ('ZooID', 'Name')" in source 
    1206                 or "    identifiers = ('Name', 'ZooID')" in source): 
     1205        if not ("    identifiers = ('ZooID', 'Name')".lower() in source.lower() 
     1206                or "    identifiers = ('Name', 'ZooID')".lower() in source.lower()): 
    12071207            self.fail("%r not found in %r" % 
    12081208                      ("    identifiers = ('ZooID', 'Name')", source))