I am getting the following error on localhost after the latest update (changeset: 1322:a4378725f3cb):
db.tester.insert(name='name') sql.pyc in insert(self, **fields) 3619 elif field.required: 3620 raise SyntaxError,'Table: missing required field: %s'%field -> 3621 return self._db._adapter.insert(self, new_fields) 3622 3623 def _truncate(self, mode = None): sql.pyc in insert(self, table, fields) 661 662 def insert(self,table,fields): --> 663 query = table._insert(**fields) 664 try: 665 self.execute(query) TypeError: _insert() argument after ** must be a mapping, not list On Dec 7, 7:19 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > I just added a partial and experiment support for couch in the new > DAL. > > I have a problem and perhaps some of you may help me. > > 1) am running couchdbx on mac (download and click, starts couchdb, no > questions asked) > > 2) I am running the following python script > > from sql import DAL, Field > db=DAL('couchdb://127.0.0.1:5984') > db.define_table('person',Field('name')) > id=db.person.insert(name='Jim') > print id > row=db.person(id) > print row #0 > print db(db.person.id==id).update(name="john") #1 > print db.person(id) #2 > print row > del db.person[id] > print db.person(id) > > It works, except that #1 returns 1 (update done) but #2 returns Jim, > not John. > What am I doing wrong? > > You can only for one record by id. > Once this works fine, extending to more complex queries should be > easy. > > I have not tried it with web2py sqlforms but it should work fine. > > Notice the code of the adapter (ChouchDBAdapter) is very small. It can > be easily be extended to other NoSQL.