More issues
1. # dlypka Mod in dal.py: had to move this try .. except up here in
front of class NoSQLAdapter because gae is needed in class
NoSQLAdapter
try:
    from new import classobj
    from google.appengine.ext import db as gae
    from google.appengine.api import namespace_manager
    # from google.appengine.api.datastore_types import Key  ### why
was this needed????
    from google.appengine.ext.db.polymodel import PolyModel
    drivers.append('gae')
except ImportError:
    pass

class NoSQLAdapter(BaseAdapter):

2. html.py line 265
    return rewrite.filter_out(url, env) # dlypka patch. Was
XML(rewrite.filter_out(url, env))
# XML() causes Exception:
#   File "C:\Program Files (x86)\Google\google_appengine\google
\appengine\api\datastore_types.py", line 1323, in ValidateProperty
#    'Unsupported type for property %s: %s' % (name, v.__class__))
#       BadValueError: Unsupported type for property success_path:
<class 'gluon.html.XML'>


3. class GAENoSQLAdapter(NoSQLAdapter):
    uploads_in_blob = True
    types = {}

    def file_exists(self, filename): pass
    def file_open(self, filename, mode='rb', lock=True): pass
    def file_close(self, fileobj, unlock=True): pass

    def __init__(self,db,uri,pool_size=0,folder=None,db_codec
='UTF-8',
                 credential_decoder=(lambda x:x)):  # dlypka patch:
added brackets around lambda - syntax error
        self.types.update({

4.     def insert(self,table,fields):
        dfields=dict((f.name,self.represent(v,f.type)) for f,v in
fields)
        # table._db['_lastsql'] = self._insert(table,fields)
        tmp = table._tableobj(**dfields)
        tmp.put()
        table._db['_last_reference'] = tmp # dlypka patched based on
June 27/2010 mod in the trunk
        rid = Reference(tmp.key().id())
        (rid._table, rid._record) = (table, None)
        return rid

Reply via email to